Search Header Logo

Depth first search (DFS) Quiz

Authored by Kenneth Tai

Computers

11th Grade

Used 7+ times

Depth first search (DFS) Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?