wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Trees, Linked Lists, Stacks and Queues

Total questions: 30

Worksheet time: 19mins

Name
Class
Date
1.
Which of these data structures is FIFO
a)
Stack
b)
Queue
c)
Binary Tree
d)
Double linked list
2.
stack overflow is an undesirable condition in which a particular computer program tries to use more memory space than the called stack has available.
a)
True
b)
False
3.
What would 'leaving' a queue be called?
a)
"Dequeue"
b)
"Enqueue"
c)
"Leave queue"
d)
"Delete 'system 32' folder"
4.
In this tree, where would the new value "7" be placed?
a)
On the left "leaf" of "4"
b)
On the right "leaf" of "6"
c)
On the left "leaf" of "15"
d)
Over the top of the current number "5"
5.
A tree is composed of ____ connected by edges or lines.
a)
Fruit 
b)
Leaf Node
c)
Root Node
d)
Nodes
6.
A Kind of tree where every node in a tree can have at most two children.
a)
Binary Tree
b)
Binary Expression Tree
c)
Tree
d)
Binary Search Tree
7.

What is the value of the ROOT node in this Tree?

a)

35

b)

24

c)

42

d)

20

8.

Root

a)

data structure similar to a graph, with no loops.

b)

an object in a graph also known as a vertex

c)

a join of relationship between nodes - also know as an arc

d)

the starting node in a rooted tree structure from which all other nodes branch off./

9.

Tree

a)

data structure similar to a graph, with no loops.

b)

an object in a graph also known as a vertex

c)

a join of relationship between nodes - also know as an arc

d)

the starting node in a rooted tree structure from which all other nodes branch off./

10.

How many leaves are there in this tree?

a)

1

b)

3

c)

4

d)

7

11.

Process of inserting an element in stack is called ____________

a)

Create

b)

Push

c)

Evaluation

d)

Pop

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)

a) ABCD

b)

b) DCBA

c)

c) DCAB

d)

d) ABDC

13.

To represent hierarchical relationship between elements, Which data structure is suitable?

a)

Dequeue

b)

Priority

c)

Tree

d)

Graph

14.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
15.

The following array is created in a program: " DIREWOLVES = ["Nymeria","Shaggy Dog","Ghost","Lady","Grey Wind","Summer"]


What is the item stored in DIREWOLVES [2] ?

a)

"Shaggy Dog"

b)

"Ghost"

16.
What is returned by values[5]?
a)
9
b)
12
c)
6
d)
8
17.

What does the term immutable mean?

a)

unable to be changed

b)

unable to speak

c)

can be modified

d)

can be increased in size

18.

Which data structure cannot have elements of different data types?

a)

Array

b)

Tuple

c)

Record

d)

Stack

e)

Queue

19.

What type of data structure is an array?

a)

Static and mutable

b)

Dynamic and immutable

c)

Static and immutable

20.

What is the value of the ROOT node in this Tree?

a)

2

b)

7

c)

11

d)

43

21.

There are two types of data structures, they are

a)

Static and dynamic

b)

Fast and slow

c)

Large and small

d)

Ascending and descending

22.

Which of the following usees FIFO method

a)

Queue

b)

stack

c)

linklist

d)

binary tree

23.

This form of access is used to add and remove nodes from a queue.

a)

LIFO, Last In First Out

b)

FIFO, First In First Out

c)

Both a and b

d)

none

24.
........ form of access is used to add remove nodes from a stack.
a)
LIFO
b)
Fifo
c)
none
d)
all
25.

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 on stack are

a)

1

b)

2

c)

3

d)

4

26.

What is the reason for using a circular queue instead of a regular queue?

a)

running time of enqueue is improved

b)

reuse empty space

c)

you can traverse the elements more efficiently

d)

none of the above

27.

If FRONT pointer= REAR pointer then the queue is?

a)

overflow

b)

underflow

c)

empty

d)

null

28.
Are stacks FIFO or FILO?
a)
FILO
b)
FIFO
c)
LIFO
d)
LILO
29.

q=Queue()

q.enQueue(‘a’)

q.enQueue(‘b’)

q.deQueue()

q.enQueue(‘c’)

q.enQueue(‘d’)

What element does the front pointer points to?

a)

'a'

b)

'b'

c)

'c'

d)

'd'

30.

q=Queue()

q.enQueue(‘a’)

q.enQueue(‘b’)

q.deQueue()

q.enQueue(‘c’)

q.enQueue(‘d’)

What element does the rear pointer point to?

a)

'a'

b)

'b'

c)

'c'

d)

'd'