37. Consider the following operation performed on a stack of size
Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);

After the completion of all operation, the number of elements present in stack is?

a) 1
b) 2
c) 3
d) 4

Answer: a
Explanation: Number of elements present in stack is equal to the difference between number of push operations and number of pop operations. Number of elements is 5-4=1.

Leave a Reply

Your email address will not be published.