employer cover photo
employer logo
employer logo

Tata Consultancy Services

Part of Tata Group

Engaged employer

Tata Consultancy Services interview question

What are Infix, prefix, Postfix notations?

Interview Answer

Anonymous

13 Dec 2019

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as A * ( B + C ) / D Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to A B C + * D/ Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to / * A + B C D