How to convert infix to postfix and evaluate postfix expression?
One of the most important applications of the Stack is the arithmetic expressions’ conversion into the programming languages of high-level into a form that the machine can read. Because the computer system can understand as well as work only on the binary language, the system assumes that the arithmetic operation is able to take place only in two operands, for example, A+B, D/A, and others. But in the usual form, one arithmetic expression can consist of two or more operators plus two operands for example (A+B)*C(D/(J+D)).
Infix Expression
This expression follows this scheme
Postfix Expression
This expression follows this scheme How to convert the Infix Expression To a Postfix Expression
Let, X, be one arithmetic expression that is written in the infix notation. Now, this algorithm finds or needs an equivalent postfix notation Y.
[here comes the end of If]
[insert the parenthesis for End of If]
[here also insert the parenthesis for End of If]