stacks and queues saving operators on stack you'll notice in both table and table that the order of the operators is reversed going from infix to postfix because the first operator can' be copied to the output until the second one has been copiedthe operators were output to the postfix string in the opposite order they were read from the infix string longer example may make this operation clearer table shows the translation to postfix of the infix expression + *( -dwe include column for stack contentswhich we'll explain in moment table translating + *( -dto postfix character read from infix expression infix expression parsed so far postfix expression written so far aa+ +ba+ * + *( + *(ca+ *( - + *( -da+ *( -da+ *( -da+ *( -da+ *( -da ab ab ab abc abc abcd abcdabcdabcdabcd-abcd-*stack contents ++*+*+*(+*(+*+*+here we see the order of the operands is +*in the original infix expressionbut the reverse order-*+in the final postfix expression this happens because has higher precedence than +and -because it' in parentheseshas higher precedence than this order reversal suggests stack might be good place to store the operators while we're waiting to use them the last column in table shows the stack contents at various stages in the translation process popping items from the stack allows you toin sensego backward (right to leftthrough the input string you're not really examining the entire input stringonly the operators and parentheses they were pushed on the stack when reading the inputso now you can recall them in reverse order by popping them off the stack the operands (aband so onappear in the same order in infix and postfixso you can write each one to the output as soon as you encounter itthey don' need to be stored on stack