wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

APPLICATIONS OF STACK

Total questions: 10

Worksheet time: 13mins

Name
Class
Date
1.

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

2.

The prefix form of an infix expression (p + q) – (r * t) is?

a)

a) + pq – *rt

b)

b) – +pqr * t

c)

c) – +pq * rt

d)

d) – + * pqrt

3.

The prefix form of A-B/ (C * D ^ E) is?

a)

a) -/*^ACBDE

b)

b) -ABCD*^DE

c)

c) -A/B*C^DE

d)

d) -A/BC*^DE

4.

The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

a)

a) AB+ CD*E – FG /**

b)

b) AB + CD* E – F **G /

c)

c) AB + CD* E – *F *G /

d)

d) AB + CDE * – * F *G

5.

If there's no base criteria in a recursive program, the program will

a)

not be executed

b)

executed until all condition matches

c)

executes infinitely

d)

obtain progressive approach

6.

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)

a) xyz*+pq*r+s*+

b)

b) xyz*+pq*r+s+*

c)

c) xyz+*pq*r+s*+

d)

d) xyzp+**qr+s*+

7.

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

a)

a) Reversing a string

b)

b) Evaluation of postfix expression

c)

c) Implementation of recursion

d)

d) Job scheduling

8.

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

a)

a) Infix Expression

b)

b) Prefix Expression

c)

c) Postfix Expression

d)

d) Both Prefix and Postfix Expressions

9.

What is the infix equivalent for the following postfix expression?


3 5 6 + *

a)

5 + 6 * 3

b)

5 + (3 * 6)

c)

(5 + 6) * 3

d)

5 (+ 6 * 3)

10.

The result evaluating the postfix expression 10 5 + 60 6 / * 8 – is

a)

284

b)

213

c)

142

d)

71