TheHingineer

  • Data Structures & Algorithms


  • DSA Part-1

  • DSA Part-2

  • DSA Part-3

  • DSA Part-4

  • DSA Part-5

  • Infix, Prefix, and Postfix Notations

    Mathematical expressions ko likhne ke teen distinct format hote hain: Infix, Prefix (Polish Notation), aur Postfix (Reverse Polish Notation). Humans infix notation prefer karte hain, jabki computers aur compilers postfix aur prefix notations use karte hain kyunki inme parentheses ki zaroorat nahi padti aur evaluation ek single linear scan me ho jata hai.

    Comparison of the Three Notations

    Notation Format Example Inventor / Name
    Infix Operand1 Operator Operand2 (A + B) * C Standard Human Format
    Prefix Operator Operand1 Operand2 * + A B C Polish Notation (Jan Łukasiewicz)
    Postfix Operand1 Operand2 Operator A B + C * Reverse Polish Notation (RPN)

    Operator Precedence and Associativity

    Operator Precedence (Priority) Associativity
    Parentheses ( ) Highest –
    Exponentiation ^ or $ Very High Right to Left
    Multiplication *, Division /, Modulo % Medium Left to Right
    Addition +, Subtraction - Low Left to Right

    Agli post me hum cover karenge Infix to Postfix Conversion using Stack (Detailed Trace Table).

    Scroll to Top