?
Consider these functions:
Consider these functions:
push() : push an element into the stack
pop() : pop the top-of-the-stack element
top() : returns the item stored in top-of-the-stack-node
What will be the output after performing these sequence of operations.
push(20);
push(4);
top();
pop();
pop();
push(5);
top();
push(20);
push(4);
top();
pop();
pop();
push(5);
top();
Join the Discussion
Login to post a comment or share your explanation.
Login