Questions & Answers of Stacks

Weightage of Stacks

Total 3 Questions have been asked from Stacks topic of Programming and Data Structures subject in previous GATE papers. Average marks 1.67.

Consider the following New-order strategy for traversing a binary tree:
  $\bullet$Visit the root;
  $\bullet$Visit the right subtree using New-order;
  $\bullet$Visit the left subtree using New-order;
The New-order traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by:

The result evaluating the postfix expression 10 5 + 60 6 / * 8 – is

The following postfix expression with single digit operands is evaluated using a stack:

8 2 3 ^ / 2 3 * + 5 1 * -

Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are: