infix expression + + * prefix expression +ab + bc postfix expression ababc table examples of infixprefixand postfix infix expression ( bc prefix expression abc postfix expression ab ctable an expression with parentheses + was written in prefixthe addition operator was simply moved before the operands+ab the result of this operation becomes the first operand for the multiplication the multiplication operator is moved in front of the entire expressiongiving us abc likewisein postfix abforces the addition to happen first the multiplication can be done to that result and the remaining operand the proper postfix expression is then ab cconsider these three expressions again (see table something very important has happened where did the parentheses gowhy don' we need them in prefix and postfixthe answer is that the operators are no longer ambiguous with respect to the operands that they work on only infix notation requires the additional symbols the order of operations within prefix and postfix expressions is completely determined by the position of the operator and nothing else in many waysthis makes infix the least desirable notation to use table shows some additional examples of infix expressions and the equivalent prefix and postfix expressions be sure that you understand how they are equivalent in terms of the order of the operations being performed conversion of infix expressions to prefix and postfix so farwe have used ad hoc methods to convert between infix expressions and the equivalent prefix and postfix expression notations as you might expectthere are algorithmic ways to perform the conversion that allow any expression of any complexity to be correctly transformed the first technique that we will consider uses the notion of fully parenthesized expression that was discussed earlier recall that can be written as ( ( )to show explicitly that the multiplication has precedence over the addition on closer observationhoweveryou can see that each parenthesis pair also denotes the beginning and the end of an operand pair with the corresponding operator in the middle look at the right parenthesis in the subexpression ( cabove if we were to move the infix expression prefix expression + * + bcd ( ( dab cd * + * ab cd + + + +abcd postfix expression abc +dab cd ab cd ab dtable additional examples of infixprefixand postfix the stack abstract data type