NIC-NIELIT Scientist-B 2020
October 6, 2023NTA UGC NET DEC-2022 Paper-1
October 6, 2023UGC NET CS 2014 Dec-Paper-2
Question 8 |
How many PUSH and POP operations will be needed to evaluate the following expression by reverse polish notation in a stack machine (A * B) + (C * D/E) ?
4 PUSH and 3 POP instructions | |
5 PUSH and 4 POP instructions | |
6 PUSH and 2 POP instructions | |
5 PUSH and 3 POP instructions |
Question 8 Explanation:
Given infix notation, we have to change infix notation into postfix notation.
after converting postfix notation the notations are ab* cde /* +

Total 5 PUSH and 4 POP operations performed.
after converting postfix notation the notations are ab* cde /* +
Total 5 PUSH and 4 POP operations performed.
Correct Answer: B
Question 8 Explanation:
Given infix notation, we have to change infix notation into postfix notation.
after converting postfix notation the notations are ab* cde /* +

Total 5 PUSH and 4 POP operations performed.
after converting postfix notation the notations are ab* cde /* +
Total 5 PUSH and 4 POP operations performed.