ISRO Computer Science (CSE) 2014 - Question 43

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2014

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is

  • A. A
  • B. B
  • C. C
  • D. D

Answer: D. D

Explanation: Stack Push: A, B, C, D, E (Top).\nPop 4: E, D, C, B.\nQueue Enqueue: E, D, C, B (Rear).\nQueue Dequeue 2: E, D.\nStack Push: A (existing), E, D.\nPop 1: D.

| | All questions of ISRO Computer Science (CSE) 2014