This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on “Stack Operations – 1”.

1. Process of inserting an element in stack is called ____________

a) Create

b) Push

c) Evaluation

d) Pop

View Answer

Explanation: None.

2. Process of removing an element from stack is called __________

a) Create

b) Push

c) Evaluation

d) Pod

View Answer

Explanation: None.

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

a) Underflow

b) Empty collection

c) Overflow

d) Garbage Collection

View Answer

Explanation: None.

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

a) Overflow

b) Crash

c) Underflow

d) User flow

View Answer

Explanation: None.

5. 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

View Answer

Explanation: None.

6. Which of the following applications may use a stack?

a) A parentheses balancing program

b) Tracking of local variables at run time

c) Compiler Syntax Analyzer

d) All of the mentioned

View Answer

Explanation: All are applications of stack.

7. 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

View Answer

Explanation: Applying the postfix expression evaluation.

8. Consider the usual algorithm for determining whether a sequence of parentheses is balanced.

Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order).

The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation?

a) 1

b) 2

c) 3

d) 4 or more

View Answer

Explanation: Applying the postfix expression evaluation.

9. What is the value of the postfix expression 6 3 2 4 + – *:

a) Something between -5 and -15

b) Something between 5 and -5

c) Something between 5 and 15

d) Something between 15 and 100

View Answer

Explanation: On solving the postfix expression the answer comes out to 18.

10. 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

View Answer

Explanation: None.

**Sanfoundry Global Education & Learning Series – Data Structure.**

To practice all areas of Data Structure, __here is complete set of 1000+ Multiple Choice Questions and Answers__.