Classical

Data Structures - Stacks

21:  

Stack A has the eintries a, b, c (with a on top), Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of stack B can only be printed. In the arrangement, which of the following permutations of a, b, c is not possible?

A.

b a c

B.

b c a

C.

c a  b

D.

a b c

 
 

Option: C

Explanation :


22:  

The postfix equivalent of the prefix * + a b - c d is

A.

ab+cd-*

B.

ab cd + - *

C.

ab + cd * -

D.

ab + - cd *

 
 

Option: A

Explanation :

The tree whose preorder traversal yields * + A B – C D, is given in fig 6.18. Writer the post-order traversal of the tree. That is the postfix form.


23:  

Stacks cannot be used to

A.

eevaluate an arithmetic expression  in postfix form

B.

iumplemen recursion

C.

convert a given arithmetic expression in infix form to its equivalent postfix form

D.

allocate resources (like CPU) by the operating system

 
 

Option: D

Explanation :


24:  

The postifx expression for the infix expression

A + B* (C+D) / F + D*E is

A.

AB+CD + *F/ D+E*

B.

ABCD + *F / + DE* +

C.

A*B + CD / F* DE ++

D.

A + *BCD/ F* DE ++

 
 

Option: B

Explanation :


25:  

Stack is useful for implemeting

A.

breadth first search

B.

depth first search

C.

recursion

D.

Both (b) & (c)

 
 

Option: D

Explanation :

Breadth first search  needs Queue for implementaion 
 




Suggest an improvement