Data Structures

1: In eveluating the arithmetic expression 2*3-(4+5),using stacks to evaluate its equivalent postfix form, which of the following stack configuration is not possible?
A. 4 6
B. 5 4 6
C. 9 6
D. 9 3 2
 

Answer : D

Explanation :
The postfix equivallent is 2 3 * 4 5 + -.
For evaluating this using stack,starting from the left,we have to scan one by one, if it is an operand push.
If it is an operator, pop it twice,apply operator on the poppedout entries and push the result onto the stack.
If we follow this,we can find configuration in option(d)is not possible

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.