Depth first search (DFS) Quiz

Depth first search (DFS) Quiz

11th Grade

8 Qs

quiz-placeholder

Similar activities

Minecraft

Minecraft

KG - Professional Development

13 Qs

RO81 LO1 Mind maps and visualisations

RO81 LO1 Mind maps and visualisations

9th - 11th Grade

12 Qs

1.1 Network Topologies

1.1 Network Topologies

KG - University

10 Qs

CP111 1st Online Live Quiz

CP111 1st Online Live Quiz

11th Grade

10 Qs

DNA trees

DNA trees

11th Grade

11 Qs

Comp Think Boss Fight 3

Comp Think Boss Fight 3

9th - 12th Grade

10 Qs

OCR ALevel CS: 1.3.2 Networks

OCR ALevel CS: 1.3.2 Networks

10th - 12th Grade

13 Qs

Networking 101

Networking 101

9th - 12th Grade

12 Qs

Depth first search (DFS) Quiz

Depth first search (DFS) Quiz

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Kenneth Tai

Used 6+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What data structure does the depth-first traversal algorithm use to keep track of the last node visited?

Queue

Stack

Array

Tree

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In a depth-first traversal, what action is taken when backtracking?

Push the current node onto the stack

Pop the previous node off the stack

Skip the current node

Add a new node to the stack

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the purpose of the stack in depth-first traversal?

To store visited nodes

To store unvisited nodes

To store the path

To store the graph

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following is a characteristic of depth-first traversal?

It is guaranteed to find the shortest path

It explores all neighbors before moving to the next level

It uses a stack to remember the path visited

It uses a queue to remember the path

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What happens when a node with no unvisited neighbors is encountered in depth-first traversal?

The node is added to the stack

The node is revisited

The traversal ends

The node is removed from the stack

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

When will the process of depth-first traversals end?

The shortest path of the nodes is found

All nodes are visited

All data in stack are popped out

All data in queue are read out

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

From the tree, which of the followings is a possible output of depth first traversal?

ABFEKDIHCFLMJ

ADIJHBEKFCGML

ADHIJCGLMBEFK

ABCDEFGHIJKLM

8.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What is the depth first traversal output of the graph?

ABEFCGD

CABDGFE

ACGDBFE

BEFACGD