Vidyalelo
Data Structure · all questions

Stacks in Data Structures
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

159

Questions

3/8

Page

Pick an option on a question to see the right answer and solution.

What is a common use case for a stack in web browsers?

Select an option to see the answer and solution.

Which of the following correctly describes a stack's push operation in terms of its effect on the stack?

Select an option to see the answer and solution.

What is the maximum number of elements that can be held in a stack if it has a capacity of 20 and 5 elements are pushed and then 3 elements are popped?

Select an option to see the answer and solution.

What type of stack implementation allows for the stack to grow dynamically as needed?

Select an option to see the answer and solution.

Evaluate the following and choose the correct answer.
a/b+c*d where a=4, b=2, c=2, d=1.

Select an option to see the answer and solution.

What would be the Prefix notation for the given equation?
a+b-c/d&e|f

Select an option to see the answer and solution.

What is the time complexity of balancing parentheses algorithm?

Select an option to see the answer and solution.

Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2)

Select an option to see the answer and solution.

Evaluate the postfix expression ab + cd/- where a=5, b=4, c=9, d=3.

Select an option to see the answer and solution.

What is the correct postfix expression for the following expression?
a+b*(c^d-e)^(f+g*h)-i

Select an option to see the answer and solution.

What would be the solution to the given prefix notation?
/ / / 16 4 2 1

Select an option to see the answer and solution.

What is the time complexity of an infix to postfix conversion algorithm?

Select an option to see the answer and solution.

What would be the Prefix notation and Postfix notation for the given equation?
A+B+C

Select an option to see the answer and solution.

Is the given statement ((A+B) + [C-D]] valid with respect to balancing of symbols?

Select an option to see the answer and solution.

What would be the Prefix notation for the given equation?
A+B*C^D

Select an option to see the answer and solution.

What would be the Prefix notation for the given equation?
A^B^C^D

Select an option to see the answer and solution.

Consider the stack
| 5 |
| 4 |
| 3 |
| 2 |.
At this point, '*' is encountered. What has to be done?

Select an option to see the answer and solution.

What would be the solution to the given prefix notation?
- + 1 2 * 3 / 6 2

Select an option to see the answer and solution.

Parentheses are simply ignored in the conversion of infix to postfix expression.

Select an option to see the answer and solution.

What is the time complexity for converting decimal to binary numbers?

Select an option to see the answer and solution.