Multiple choice

Let there be a stack of integer values. How many elements does the stack contain after following operations? PUSH(S,1), PUSH(S,2), … , PUSH(S,10) Multipop(S,5) PUSH(S,11), PUSH(S,12), … , PUSH(S, 30) Multipop(S,10)

  1. 20

  2. 30

  3. 10

  4. 15

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

Initially push 10 elements (size 10). Multipop(5) leaves 5. Push 20 elements (11 to 30) makes size 25. Multipop(10) leaves 15.