LogIn
I don't have account.
Question 1
What happens when we try to pop an element from an empty stack?
1
Underflow
2
Overflow
3
Segmentation fault
4
None of the above
Question 2
Which one of the following is an application of Stack Data Structure?
1
Managing function calls
2
The stock span problem
3
Arithmetic expression evaluation
4
All of the above
Question 3
The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
1
C
2
D
3
A
4
B
Question 4
What will be the output of the following code?
stack = []
stack.append(1)
stack.append(2)
stack.append(3)
print(stack.pop(), stack.pop())
1
1 2
2
1 3
3
3 2
4
2 3