Multiple choice

In an empty stack, perform the following operations: push (A), push (B), push (C), pop, pop, push (D), push (E), pop. What is the value of the top of the stack?

  1. D

  2. A

  3. B

  4. C

  5. E

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

It is the right answer. According to the given operations, first push A, then B and C. After that, perform the pop operation two times. This will delete B and C. Now again, push D and E, at last perform the pop operation, which deletes the last inserted item E. Now, the value of the top of the stack is D.