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

4/8

Page

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

What should be done when an opening parentheses is read in a balancing symbols algorithm?

Select an option to see the answer and solution.

What is the value of the postfix expression 2 3 + 4 5 6 - - *

Select an option to see the answer and solution.

Evaluation of infix expression is done based on precedence of operators.

Select an option to see the answer and solution.

Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?

Select an option to see the answer and solution.

Reverse Polish Notation is the reverse of a Polish Notation.

Select an option to see the answer and solution.

Using the evaluation of prefix algorithm, evaluate +-9 2 7.

Select an option to see the answer and solution.

Which of the following statement is incorrect with respect to balancing symbols algorithm?

Select an option to see the answer and solution.

An error is reported when the stack is not empty at the end.

Select an option to see the answer and solution.

How many stacks are required for reversing a word algorithm?

Select an option to see the answer and solution.

Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2.

Select an option to see the answer and solution.

The time complexity of converting a prefix notation to infix notation is . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following program?
main()  
{  
   char str[]="hello india";  
   int len = strlen(str);  
   int i;  
 
   for(i=0;i<len;i++)  
        push(str[i]);  // pushes an element into stack
 
   for(i=0;i<len;i++)  
      pop();  //pops an element from the stack
}

Select an option to see the answer and solution.

Which is the most appropriate data structure for reversing a word?

Select an option to see the answer and solution.

What is the number of moves required to solve Tower of Hanoi problem for k disks?

Select an option to see the answer and solution.

The postfix expression abc+de/*- is equivalent to which of the following infix expression?

Select an option to see the answer and solution.

An error is thrown if the character '\n' is pushed in to the character stack.

Select an option to see the answer and solution.

Which of the following is valid reverse polish expression?

Select an option to see the answer and solution.

The prefix expression of the postfix expression AB+CD-* is . . . . . . . .

Select an option to see the answer and solution.

Which of these operators have the highest order of precedence?

Select an option to see the answer and solution.

From the given expression tree, identify the infix expression, evaluate it and choose the correct result.
Stacks in Data Structures mcq question image

Select an option to see the answer and solution.