NEW
Font size
WorksheetsData Structure (Stack) quiz - 4
Total questions: 10
Worksheet time: 9mins
The result evaluating the postfix expression
10 5 + 60 6 / * 8 –
is
284
213
142
71
Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?
Underflow occurs
Stack operations are performed smoothly
Overflow occurs
None of these
Postfix of
(A + B^ D) / (E – F) + G
is
ABD + ^EF – / G+
ABD + ^EF / – G+
ABD^ + EF – / G+
ABD^ + EF / – G+
What is the main principle behind the stack data structure?
FIFO (First In, First Out)
LIFO (Last In, First Out)
Priority Queue
None of these
What is the time complexity for the push and pop operations in a stack
O(n)
O(n^2)
O(1)
O(logn)
In which real-world scenario can a stack be applied?
Undo functionality in text editors
Browser history navigation
Both of these
None of these
What would happen if we use a stack with a fixed size and try to perform a push operation when the stack is full?
The new element is ignored
Underflow error
The stack automatically expands
Overflow error
Which of the following is not an application of stack?
Recursion
Tower of Hanoi
Undo operation in text editor
Task scheduling
Postfix expression evaluation
What is the time complexity to empty the stack of size N?
O(1)
O(N)
O(n^2)
O(logn)
What is the output of evaluation of
+, -, *, 3, 2, /, 8, 4, 1
11
12
5
4
