Question
Easy

Let the postfix expression 3, 2, +, 7, *, 6, 5, +, 4, *, is being evaluated using a stack. What are the values on top and bottom of stack respectively, just before second + operator is evaluated?

1
27, 5
2
11, 35
3
11, 27
4
5, 35
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Data Structures (Through C++)
Topic: Stack
Correct Answer
Option D
Explanation

The correct option is (4): The evaluation of a postfix expression using a stack follows a clear LIFO (Last-In, First-Out) principle, where operands are pushed onto the stack, and operators pop the required number of operands, perform the operation, and push the result back. Following the expression $3, 2, +, 7, \*, 6, 5, +, 4, *$: First, '3' and '2' are pushed, then the first '+' is encountered, resulting…Read More