Skip to content
Sign in
Computer

Which data structure would you use to evaluate an expression given in postfix notation?

Tap an option to check the answer. You can also press A–D.

Show answer

Correct answer: A) Stack

A stack is used to evaluate postfix expressions as it allows operations in a last-in, first-out (LIFO) order.Operands are pushed onto the stack.Operators pop operands for computation, pushing the result back.
Explanation
A stack is used to evaluate postfix expressions as it allows operations in a last-in, first-out (LIFO) order.Operands are pushed onto the stack.Operators pop operands for computation, pushing the result back.