Stack  Linear Data Structures, Power Booster, Smart Tools For Best Engineer, Developer Must Know Things, Evaluating Postfix expressions
Infix, Prefix and Postfix Expressions:
Examples:
Infix Expression

Prefix Expression

Postfix Expression

A + B 
+ A B 
A B + 
A + B * C 
+ A * B C 
A B C * + 
(A + B) * C 
* + A B C 
A B + C * 
A + B * C + D 
+ + A * B C D 
A B C * + D + 
(A + B) * (C + D) 
* + A B + C D 
A B + C D + * 
A * B + C * D 
+ * A B * C D 
A B * C D * + 
A + B + C + D 
+ + + A B C D 
A B + C + D + 
Algorithm for evaluating postfix expression:
 Create an empty stack called myStack.
 Convert the string to a list by using the string method split.
 Scan the token list from left to right.
 If the token is an operand, convert it from a string to an integer and push the value onto the myStack.
 If the token is an operator, *, /, +, or , it will need two operands. Pop the myStack twice. The first pop is the second operand and the second pop is the first operand. Perform the arithmetic operation. Push the result back on the myStack.
 When the input expression has been completely processed, the result is on the stack. Pop the myStack and return the value.
Reference :
 http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpressions.html
 https://www.cs.cmu.edu/~adamchik/15121/lectures/Stacks%20and%20Queues/Stacks%20and%20Queues.html
Linear, Stack, Data Structures,Must Know, Developer, Engineer, Development Tools, Power Booster, Smart Tools, Good Practices
thingswelearned.com
http://thingswelearned.com/article/show/evaluatingpostfixexpressions
Tags:Linear, Stack, Data Structures,Must Know, Developer, Engineer, Development Tools, Power Booster, Smart Tools, Good Practices
Type: Technical
Types_Sub: Linear, Stack, Data Structures,Must Know, Developer, Engineer, Development Tools, Power Booster, Smart Tools
Cat: Linear, Stack, Data Structures,Must Know, Developer, Engineer, Development Tools, Power Booster, Smart Tools
Cat_Sub: Linear, Stack, Data Structures,Must Know, Developer, Engineer, Development Tools, Power Booster, Smart Tools
Hidden Text :