Which of the following data structures is most suitable for evaluating postfix…
2017
Which of the following data structures is most suitable for evaluating postfix expressions?
- A.
Tree
- B.
Stack
- C.
Linked list
- D.
Queue
Attempted by 1590 students.
Show answer & explanation
Correct answer: B
Postfix expression evaluation uses a stack because operands are pushed onto the stack, and when an operator is encountered, operands are popped, evaluated, and the result is pushed back onto the stack.