wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Stack & Quiz

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

Only top element can be accessed in stack

a)

TRUE

b)

FALSE

2.

Stacks have LIFO ordering

a)

TRUE

b)

FALSE

3.

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

a)

AB + CDE * - * F *G /

b)

AB+ CD*E - FG /**

c)

AB + CD* E - F **G /

d)

AB + CD* E - *F *G /

4.

Which of them is an abstract data structure (ADT)?

a)

Stacks

b)

Functions

c)

Queues

d)

Both A and C

5.

LIFO stands for

a)

List of Outputs

b)

Last in First Out

c)

First in Last Out

d)

None of them

6.

Act of adding values into a stack is called

a)

Popping

b)

Polling

c)

Pushing

d)

None

7.

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

a)

*AB/CD+

b)

AB*CD/+

c)

A*BC+/D

d)

ABCD+/*

8.

Convert the following Infix expression to Postfix form using a stack


x + y * z + (p * q + r) * s

a)

xyz*+pq*r+s*+

b)

xyz*+pq*r+s+*

c)

xyz+*pq*r+s*+

d)

none

9.

Which of the following statement(s) about stack data structure is/are NOT correct?

a)

Stack data structure can be implemented using linked list

b)

New node can only be added at the top of the stack

c)

Stack is the FIFO data structure

d)

The last node at the bottom of the stack has a NULL link

10.

Which of the following application generally use a stack?

a)

Parenthesis balancing program

b)

Syntax analyzer in compiler

c)

Keeping track of local variables at run time

d)

All of the above

11.

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 no of element present on stack are

a)

1

b)

2

c)

3

d)

4

12.

If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

13.

In linked list implementation of a queue, where does a new element be inserted?

a)

At the head of link list

b)

At the centre position in the link list

c)

At the tail of the link list

d)

None of the mentioned

14.

In linked list implementation of a queue, from where is the item deleted?

a)

At the head of link list

b)

At the centre position in the link list

c)

At the tail of the link list

d)

None of the mentioned

15.

In linked list implementation of a queue, the important condition for a queue to be empty is?

a)

FRONT is null

b)

REAR is null

c)

LINK is empty

d)

None of the mentioned

16.

What is the term for inserting into a full queue known as?

a)

overflow

b)

underflow

c)

null pointer exception

d)

all of the mentioned

17.

a QUEUE in a computer acts just like people queuing for a bus - the first person in queue is going to be the first to get on the bus.

a)

True

b)

False

18.

A Queue uses a front and rear pointer?

a)

True

b)

False

19.
Which of these data structures is FIFO
a)
Stack
b)
Queue
c)
Binary Tree
d)
Double linked list
20.
What is returned by values[5]?
a)
9
b)
12
c)
6
d)
8