+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following is valid reverse polish expression?

(a) a op b

(b) op a b

(c) a b op

(d) both op a b and a b op

This interesting question is from Application of Stacks topic in chapter Application of Stacks of Data Structures & Algorithms I

This question was posed to me during a job interview.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
The correct choice is (c) a b op

The best explanation: The postfix expression is also known as the reverse polish expression. In postfix expressions, the operators come after the operands. So, the correct expression is a b op and hence a b op is correct.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.