wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2.3.1 Graph Traversal & Path Finding Algorithms

Total questions: 20

Worksheet time: 14mins

Name
Class
Date
1.

What supporting data structure is used for traversing a graph based on the depth-first traversal technique?

a)

Stack

b)

Queue

c)

Circular Queue

d)

2D Array

2.

What supporting data structure is used for traversing a graph based on the breadth-first traversal technique?

a)

Stack

b)

Queue

c)

Circular Queue

d)

2D Array

3.

Depth-first traversal is equivalent to which of the following traversal of trees?

a)

Pre-order

b)

Post-order

c)

In-order

4.

An approach to problem-solving in which different sequences are considered until the best suitable solution is found is called

a)

Traversal

b)

Heuristics

c)

Backtracking

d)

Data Mining

5.

If visitedNodes = [A], what is the value of visitedNodes in the next step?

a)

visitedNodes = [B]

b)

visitedNodes = [B, C]

c)

visitedNodes = [B, C, D]

d)

visitedNodes = [A, B]

6.

If node C has been visited in the current step, what is the value of visitedNodes?

Select All That Apply.

a)

visitedNodes = [A, B, E, I, C]

b)

visitedNodes = [A, B, E, I, F, C]

c)

visitedNodes = [A, B, E, I, F, J, G, C]

d)

visitedNodes = [A, B, E, I, F, J, D, C]

7.

If node D is visited in the current step, what is the value of the supporting data structure?

a)

[A]

b)

[A, B, C]

c)

[A, B, C, D]

d)

[D, B, C, A]

8.

Node A is visited in the current step and nodelist = [A]. What is the value of supporting data structure in the next step?

a)

[B, D]

b)

[B]

c)

[D]

d)

[B, C, D]

9.

Node D is added to the list of nodelist in the current step. Assuming that D’s neighbours are also added, what is the value of supporting data structure?

a)

[B, C]

b)

[E, F, G]

c)

[G, F, E]

d)

[A, B, C, D]

10.

What is the order of nodes visited for depth-first traversal of this tree?

a)

ABCDEFG

b)

ABECFDG

c)

ABCEFDG

d)

ABECFGC

11.

When a program theoretically can be solved, but if they take potentially millions of years to physically solve, they are classed as _______.

a)

Insoluble

b)

Computable

c)

Tractable

d)

Incomputable

12.

When a problem can be solved with an algorithm which has a polynomial time complexity or better (eg, O(n), O(n^2), O(n^k) ).

a)

Insoluble

b)

Computable

c)

Tractable

d)

Intractable

13.

When a problem does not have a polynomial time solution – may have a theoretical solution but would be impossible to solve the problem within a reasonable time frame (eg, O(2^n), O(n!) ).

a)

Incomputable

b)

Computable

c)

Tractable

d)

Intractable

14.

A problem is defined as being ________ if there is an algorithm that can solve every instance of it in a finite number of steps.

a)

Insoluble

b)

Computable

c)

Tractable

d)

Intractable

15.

What is the order of nodes visited for breadth-first traversal of this tree?

a)

ABCDEFG

b)

ABECFDG

c)

ABCEFDG

d)

ABECFGC

16.

Optimisation algorithms are designed to find the (a)   path from a start node to any other node

17.

Select all correct applications of a shortest-path algorithm

a)

Navigation

b)

NPC control in gaming

c)

Sending data packets

d)

Financial investment choices

e)

AI neural network training

18.

Which type of queue is used in Dijkstra's Algorithm?

a)

Priority

b)

Circular

c)

Linear

19.

In Dijkstra's algorithm, before looping through the nodes, the value for the starting node is set to 0

a)

True

b)

False

20.

In Dijkstra's algorithm, before looping through the nodes, the value for every node other than the starting node is set to 0

a)

True

b)

False