wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structures - Tree

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.
A tree is composed of ____ connected by edges or lines.
a)
Fruit 
b)
Leaf Node
c)
Root Node
d)
Nodes
2.
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
3.

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

a)

35

b)

24

c)

42

d)

20

4.

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./

5.

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./

6.

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

a tree where each node can only have 2 child nodes attached to it

7.

In preorder traversal of a binary tree the second step is ____________

a)

traverse the right subtree

b)

traverse the left subtree

c)

traverse right subtree and visit the root

d)

visit the root

8.

The decision tree structure begins at a node called the _____.

a)

span

b)

top

c)

root

d)

branch

9.

How many leaf are there in the tree?

a)

1

b)

3

c)

4

d)

7

10.
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"
11.

Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?

a)

Pre-Order

b)

In-Order

c)

Post-Order

d)

Monastic Orders

12.

What are the 3 depth traversals for a tree data structure?

a)

Pre-, In- and Post-order

b)

Pro-, In- and Past-order

c)

Pre-, Out- and Post-order

d)

Pre-, In- and New-order

13.

When traversing a binary tree, which diagram is post-order?

a)
b)
c)
14.

When traversing a binary tree, which diagram is pre-order?

a)
b)
c)
15.

A Data Structure is:

a)

A C++ vector

b)

A way of organizing, storing and performing operations on data.

c)

A function in any programming language

d)

A sequence of steps to solve a problem.

16.

Given a sequence of number below:

50,60,40,70,45,55,30,80,65,35,25,75,85


When creating a binary search tree, what is the height of the tree?

a)

3

b)

4

c)

5

d)

6

17.

Given a binary search tree, insert 27, 15, 63, 99, 70 and 85 (in this order) into the binary search tree. What is the post-order traversal?

a)

5,15,27,34,47,54,63,70,72,75,83,85,88,94,99,101

b)

72,54,34,5,27,15,47,63,70,83,75,88,85,101,94,99

c)

15,27,5,47,34,70,63,54,75,85,99,94,101,88,83,72

d)

15,27,5,47,34,63,54,70,75,85,99,94,101,88,83,72

e)

none of the above

18.
A Balanced Tree has equal number of items on each subtree.
a)
True
b)
False
19.
Root has more left descendants than the right descendants or vice versa.
a)
Balanced Tree
b)
Perfect Tree
c)
Right Tree
d)
Unbalanced Tree
20.

Choose the correct statement

a)

A data structure is a specialised format for organising and storing data

b)

A data structure is a specialised format for organising and storing information

c)

A data structure is a format for organising and storing only one data type

d)

A data structure is too complicated to truly understand or use