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

6/8

Page

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

Which of the following does the balancing symbols algorithm include?

Select an option to see the answer and solution.

Find the error (if any) in the following code snippet for pop operation.
void pop() //removing an element from a stack
{
     printf(“%s”, stack[top++]);
}

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which data structure can be used to test a palindrome?

Select an option to see the answer and solution.

Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 4*2+3-5/5

Select an option to see the answer and solution.

The result of the postfix expression 5 3 * 9 + 6 / 8 4 / + is . . . . . . . .

Select an option to see the answer and solution.

When an operand is read, which of the following is done?

Select an option to see the answer and solution.

Find the output of the following prefix expression.
*+2-2 1/-4 2+-5 3 1

Select an option to see the answer and solution.

Which of the following is an example for a postfix expression?

Select an option to see the answer and solution.

What should be done when a left parenthesis '(' is encountered?

Select an option to see the answer and solution.

Of the following choices, which operator has the lowest precedence?

Select an option to see the answer and solution.

What would be the solution to the given prefix notation?
- + 5 / 10 5 5

Select an option to see the answer and solution.

It is easier for a computer to process a postfix expression than an infix expression.

Select an option to see the answer and solution.

If -*+abcd = 11, find a, b, c, d using evaluation of prefix algorithm.

Select an option to see the answer and solution.

The associativity of an exponentiation operator ^ is right side.

Select an option to see the answer and solution.

While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?

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 is the corresponding postfix expression for the given infix expression?
a+(b*c(d/e^f)*g)*h)

Select an option to see the answer and solution.

Identify the infix expression from the list of options given below.

Select an option to see the answer and solution.

The optimal data structure used to solve Tower of Hanoi is . . . . . . . .

Select an option to see the answer and solution.