Postfix to Infix conversion

 Postfix to Infix conversion

================================================================================

  • Infix expression: The expression of the form a operator b (a + b). When an operator is in-between every pair of operands.
  • Postfix expression: The expression of the form a b operator (ab+). When an operator is followed by every pair of operands.
Postfix to Infix conversion

  • Algorithm:
    1. first we group the token from left to right
    2. all operators move  in between two operands

  • eg.
    • A B + C D - * E /

    • Solution: 
      • A B + C D - * E /
      • A + B C - D * E /
      • A + B * C - D E /
      • A + B * C - D / E


Comments

Popular posts from this blog

TREE

STACK

Evaluation of postfix expression