Given an empty stack, after performing push(1), push(2), pop, push(3), push(4), pop, pop, push(5), pop, what is the value of the top of the stack?
Hence,Option(D)1 is the correct choice.
Answer: 1
Push 1 Push 2
1 Pop 2
1 Push 3 Push 4
1 Pop 4 Pop 3
1 Push 5
1 Pop 5
1 <=== Answer
64.3k questions
77.9k answers
244k comments
80.0k users