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

7/8

Page

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

Which among the following is not a palindrome?

Select an option to see the answer and solution.

How many passes does the balancing symbols algorithm makes through the input?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

While evaluating a prefix expression, the string is read from?

Select an option to see the answer and solution.

Reversing a word using stack can be used to find if the given word is a palindrome or not.

Select an option to see the answer and solution.

hat is the postfix expression for the corresponding infix expression?
a+b*c+(d*e)

Select an option to see the answer and solution.

Which of the following is not an application of stack?

Select an option to see the answer and solution.

How many passes does the evaluation of infix expression algorithm makes through the input?

Select an option to see the answer and solution.

Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?

Select an option to see the answer and solution.

When converting the prefix notation into an infix notation, the first step to be followed is . . . . . . . .

Select an option to see the answer and solution.

How many types of input characters are accepted by this algorithm?

Select an option to see the answer and solution.

Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right associative. Then, equivalent infix expression is

Select an option to see the answer and solution.

In infix to postfix conversion algorithm, the operators are associated from?

Select an option to see the answer and solution.

Which of the following is an infix expression?

Select an option to see the answer and solution.

Evaluate and write the result for the following postfix expression
abc*+de*f+g*+ where a=1, b=2, c=3, d=4, e=5, f=6, g=2.

Select an option to see the answer and solution.

For the given expression tree, write the correct postfix expression.
Stacks in Data Structures mcq question image

Select an option to see the answer and solution.

In the given C snippet, find the statement number that has error.
//C code to push an element into a stack
void push( struct stack *s, int x) 
{
    if(s->top==MAX-1)
    {
        printf(“stack overflow”);
    }
    else
    {
        s->items[++s->top]=x;
        s++;
    }   
 }

Select an option to see the answer and solution.

Operations required for reversing a word or a string using stack are push() and pop().

Select an option to see the answer and solution.

In balancing parentheses algorithm, the string is read from?

Select an option to see the answer and solution.

What will be the word obtained if the word "abbcabb" is reversed using a stack?

Select an option to see the answer and solution.