Wednesday, 25 October 2017

Net 27

CBSE NET January 2017 PAPER II

DATA STRUCTURE

Q. The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue. Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ...................

(A) A
(B) B
(C) F
(D) G

Ans :- (B)

Explanation:-
Push GFEDCBA
A
B
C
D
E
F
G


Pop 5 times and pop elements are queued EDCBA
F
G
2 elements deleted from queue, EDC, and pop in to stack
B
A
F
G


1 element pop from stack. That is B
A
F
G


Related topics

Professor Jayesh video tutorial

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.