5.Infix And Prefix and Postfix Conversions
Infix to Postfix
Given an infix expression in the form of string str. Convert this infix expression to postfix expression.
Infix expression: The expression of the form a op b. When an operator is in-between every pair of operands.
Postfix expression: The expression of the form a b op. When an operator is followed for every pair of operands. Note: The order of precedence is: ^ greater than * equals to / greater than + equals to -.
Example 1:
Example 2:
Solution:
Last updated