简体   繁体   中英

Infix To Postfix Conceptual

I'm currently studying for a final right now, and this is something I never understood how to do. On one of my homework questions, I was asked whether some provided postfix expressions were valid or invalid. Is there any surefire way to know this?

Thanks

Evaluate it. Push each number; when you encounter an operator, pop two values, apply the operator to them, and push the result. There should be no stack underflows, and at the end there should be exactly one stack element.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM