## Stacks Solved MCQs Questions Answers

Let us see the Stacks Solved MCQs Questions Answers.

1. In stack Process of inserting an value is called ____________

a. Create

b. Push

c.Pop

d. Evaluation

e. both a & b

f.none of these

Answer b

2. In stack the process of removing an from is called __________

a. Create

b. Push

c. Evaluation

d. Pop

e. both a & b

f. none of these

Answer d

3. If user tries to remove value from empty stack it is called _________

a. Underflow

b. Empty collection

c. Overflow

d. Garbage Collection

e. both a & b

f. none of these

Answer: a

4. In a stack of size of 5, Pushing values into stack more than five, then stack becomes

a. Overflow

b. User flow

c. Crash

d. Underflow

e. both a & b

f. none of these

Answer: a

5. What is meant by this statement : Entries in a stack are “ordered”.?

a. A collection of stacks is sortable

b. The entries are stored in a linked ‘<‘ operation

c.listStack entries may be compared with the

d. There is a Sequential entry that is one by one

e. both a & b

f. none of these

Answer : d

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

a) Parentheses balancing program

b) Tracking of local variables at run time

c) Compiler Syntax Analyzer

d) Data Transfer between two asynchronous process

Answer: d

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

Answer: c

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) 6

d) 4 or more

Answer: b

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

a) 1

b) 40

c) 74

d) -18

View Answer

Answer: d

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.

In this scenario, what will be the maximum number of symbols that will appear on the stack at the given time during the conversion of this expression?

a) 6

b) 5

c) 3

d) 4

Answer: d

- List of Public service commissions - August 31, 2020
- Comparison of fee structure of Pakistani Universities - June 1, 2020
- Past Guess Paper of Auditing - May 12, 2020