To evaluate an expression without any embedded function calls :

2002

To evaluate an expression without any embedded function calls :

Answer: B. One stack is enoughWithout embedded function calls, expression evaluation does not need activation records for nested calls. A single stack can store operands and intermediate…

  1. A.

    As many stacks as the height of the expression tree are needed

  2. B.

    One stack is enough

  3. C.

    Two stacks are needed

  4. D.

    A Turing machine is needed in the general case

Attempted by 450 students.

Show answer & explanation

Correct answer: B

Without embedded function calls, expression evaluation does not need activation records for nested calls. A single stack can store operands and intermediate results while the expression is evaluated, for example in postfix evaluation. Hence one stack is enough.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…