# Stack Operations | Data Structure MCQs

1.

In a stack, if a user tries to remove an element from empty stack it is called ______

A.) Empty collection
B.) Underflow
C.) Overflow
D.) Garbage Collection

Underflow

2.

The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?

A.) 350
B.) 150
C.) 450
D.) 550

350

3.

The postfix form of A*B+C/D is?

A.) *AB/CD+
B.) AB*CD/+
C.) A*BC+/D
D.) ABCD+/*

AB*CD/+

4.

Assume that the operators +,-, X are left associative and ^ is right associative.
The order of precedence (from highest to lowest) is ^, X, +, -. The postfix expression for the infix expression a + b X c – d ^ e ^ f is

A.) abc X+ def ^^ –
B.) ab+c Xd – e ^f^
C.) abc X+ de^f^ –
D.) -+aXbc^ ^def

abc X+ def ^^ –

5.

Convert the following Infix expression to Postfix form using a stack
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

A.) xyz*+pq*r+s*+
B.) xyz*+pq*r+s+*
C.) xyz+*pq*r+s*+
D.) None of the mentioned

xyz*+pq*r+s*+

6.

If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?

A.) ABCD
B.) DCAB
C.) DCBA
D.) ABDC

DCBA

7.

If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?

A.) ABCD
B.) DCBA
C.) DCAB
D.) ABDC

DCBA

8.

Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the number of elements present in stack are

A.) 1
B.) 2
C.) 3
D.) 4

1

9.

The type of expression in which operator succeeds its operands is?

A.) Infix Expression
B.) Prefix Expression
C.) Postfix Expression
D.) None of the mentioned

Postfix Expression

10.

Consider the usual algorithm for determining whether a sequence of parentheses is balanced.
The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(())) are:

A.) 1
B.) 2
C.) 3
D.) 4 or more

Applying the postfix expression evaluation.

11.

Which of the following is not an inherent application of stack?

A.) Reversing a string
B.) Job scheduling
C.) Evaluation of postfix expression
D.) Implementation of recursion

Reversing a string

12.

Process of inserting an element in stack is called ___________

A.) Create
B.) Push
C.) Evaluation
D.) Pop

Push
Self Explanatory.

13.

Pushing an element into stack already having five elements and stack size of 5 , then stack becomes

A.) Crash
B.) Overflow
C.) User flow
D.) Underflow

Overflow

14.

Entries in a stack are “ordered”. What is the meaning of this statement?

A.) A collection of stacks is sortable.
B.) Stack entries may be compared with the ‘<‘ operation.
C.) The entries are stored in a linked list.
D.) There is a Sequential entry that is one by one.

There is a Sequential entry that is one by one.

15.

Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation.
The maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression?

A.) 1
B.) 2
C.) 3
D.) 4