Question 11
EasyWhat is stack underflow?
- A.
A stack that is too large
- B.
Trying to pop from an empty stack
- C.
Pushing onto a full stack
- D.
A stack with one element
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
What is stack underflow?
A stack that is too large
Trying to pop from an empty stack
Pushing onto a full stack
A stack with one element
Sign up free to see the answer and a step-by-step explanation.
Starting with an empty stack, you push 1, 2 and 3 and then pop once. What is on top now?
2
1
The stack is empty
3
Sign up free to see the answer and a step-by-step explanation.
Which data structure is used to check whether the brackets in an expression are balanced?
A stack
A hash table
A queue
A heap
Sign up free to see the answer and a step-by-step explanation.
Is the bracket string '(()' balanced?
It can't be decided
Yes
No; one '(' is never closed
Only in Python
Sign up free to see the answer and a step-by-step explanation.
Which data structure lets an editor's undo feature reverse the most recent action first?
A queue
A graph
A binary tree
A stack
Sign up free to see the answer and a step-by-step explanation.
A browser's back button returns to pages in reverse order of visiting. Which structure models this?
A hash map
A queue
A stack
A heap
Sign up free to see the answer and a step-by-step explanation.
You push each character of 'CAT' onto a stack and then pop them all. In what order do they come out?
A, C, T
C, T, A
T, A, C
C, A, T
Sign up free to see the answer and a step-by-step explanation.
What is the value of the postfix expression 2 3 + 4 *?
24
14
9
20
Sign up free to see the answer and a step-by-step explanation.
What is the value of the postfix expression 5 1 2 + 4 * + 3 −?
16
18
12
14
Sign up free to see the answer and a step-by-step explanation.
What is the prefix (Polish) form of A + B?
A B +
A + B
Sign up free to see the answer and a step-by-step explanation.