wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

STACK DATA STRUCTURE

Total questions: 45

Worksheet time: 34mins

Name
Class
Date
1.

Stacks have LIFO ordering

a)

TRUE

b)

FALSE

2.

LIFO stands for

a)

List of Outputs

b)

Last in First Out

c)

First in Last Out

d)

None of them

3.

Act of adding values into a stack is called

a)

Popping

b)

Polling

c)

Pushing

d)

None

4.

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

5.

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

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

6.

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

7.
Are stacks FIFO or FILO?
a)
FILO
b)
FIFO
c)
LIFO
d)
LILO
8.

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is

a)

A

b)

B

c)

C

d)

D

e)

E

9.

Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?

a)

Underflow occurs

b)

Stack operations are performed smoothly

c)

Overflow occurs

d)

None of the above

10.

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

a)

Implementation of recursion

b)

Evaluation of a postfix expression

c)

Job scheduling

d)

Reverse a string

11.

In the stack process of inserting an element in the stack is called as _____________________

a)

Create

b)

Evaluation

c)

Push

d)

Pop

12.

Process of Removing element from the stack is called as __________.

a)

Pop

b)

Push

c)

Create

d)

Postfix

13.

In the stack, If user try to remove element from the empty stack then it called as ___________.

a)

Overflow of Stack

b)

Empty Collection

c)

Underflow of Stack

d)

Garbage Collection

14.

User push 1 element in the stack having already five elements and having stack size as 5 then stack becomes ___________.

a)

Overflow

b)

User Flow

c)

Underflow

d)

Crash

15.

In order to keep track of current topmost element of the stack we need to maintain one variable.

a)

Yes

b)

No

c)

Both Yes and No

d)

None of the answer

16.

Select a real life situation implement stack

a)

All of the answers

b)

The cars a garage the first car in will be the last car out of the garage

c)

The batteries in a flashlight

d)

The person wear bangles

17.

Stacks have LIFO ordering

a)

TRUE

b)

FALSE

18.

Act of adding values into a stack is called

a)

Popping

b)

Pushing

c)

Polling

d)

None

19.

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)

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

HIDE ANSWER

d)

Stack is the FIFO data structure

20.

A stack is a data structure in which elements?

a)

Can be added to any position and removed only from the top

b)

Can be only added to the top and removed from any position

c)

Can be added and removed from the top only

d)

Can be added and removed from any position

21.

Only top element can be accessed in stack?

a)

TRUE

b)

FALSE

c)

MAYBE

d)

SOMETIMES

22.

What is a stack?

a)

A data structure that removes the first added data item.

b)

A data structure that increases data items first.

c)

Data structure that removes the last added data item first

d)

A data structure that multiplies data items

23.

What two operations do stacks require?

a)

Push

b)

Draw

c)

Stretch

d)

Drag

e)

Pop

24.

If you have a stack containing 'A' 'D' 'G' . What will happen if you push 'C' into the stack?

a)

'C' Will be added on top of the stack

b)

'C' Will be added from the bottom of the stack

c)

'C' Will be removed from the stack

d)

'C' Will not be added to the stack

25.

A stack containing 'Dog' 'Cat' & 'Rat' . What will happen if you carry out a pop operation on the stack ?

a)

Stack overflow

b)

Cat will be removed

c)

Dog will be removed

d)

Rat will be removed

26.

If you carry out a pop operation on this stack what will you be left with?

a)
b)
c)
27.

What will happen if you carry out a push operation with the word 'Bill'?

a)
b)
c)
28.

What are Stacks Used For?

a)

Type in data from keyboard

b)

To remove data

c)

To stack information

d)

To keep track of a sequence of operations

29.

When an interrupt occurs, where is the current instruction placed in the stack?

a)

On top

b)

The bottom

c)

The side

d)

No where

30.

The general principle of stack is

a)

When do pop, top element is removed

b)

First in and first out

c)

Use push to remove element

d)

Use pop to insert element

31.

The general principle of stack is:

a)

Use pop to insert element

b)

Use push to remove element

c)

First in and first out

d)

When do push, the element is inserted at the top

32.

When you want to remove in a stack, you remove the topmost item first.

a)

True

b)

False

33.

A very simple illustration of a stack is a pile of books wherein you can add a book at the bottom.

a)

True

b)

False

34.

The stack overflow condition occurs when we try to insert elements in an empty stack.

a)

True

b)

False

35.

The underflow condition occurs when we try to remove elements from a full stack.

a)

True

b)

False

36.

The push operation is the process of adding new elements in the stack.

a)

True

b)

False

37.

The pop operation is the process of removing elements from a stack.

a)

True

b)

False

38.

Peek is an operation that returns the value of the topmost element of the stack.

a)

True

b)

False

39.

Stacks can be represented using arrays or using a linked list data structures.

a)

True

b)

False

40.

One of the applications of the stack is polish and reverse polish notations.

a)

True

b)

False

41.

The three basic operations that can be performed on the stacks are push, pop, and peek operations.

a)

True

b)

False

42.

What is a data structure where the last item added is the first item removed?

a)

Stack

b)

Queue

c)

Tree

d)

Hash Table

43.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

44.

Consider the following operations performed on a stack of size 5 : Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?

a)

Underflow occurs

b)

Stack operations are performed smoothly

c)

Overflow occurs

d)

None of the above

45.

If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values

a)

2,2,1,1,2

b)

2,2,1,2,2

c)

2,1,2,2,1

d)

2,1,2,2,2