
Depth first search (DFS) Quiz

Quiz
•
Computers
•
11th Grade
•
Medium

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
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
What is the depth first traversal output of the graph?
ABEFCGD
CABDGFE
ACGDBFE
BEFACGD
Similar Resources on Wayground
12 questions
AP CSP BI 4

Quiz
•
9th - 12th Grade
8 questions
Linguaggio Java - Liste, Pile, Code

Quiz
•
11th - 12th Grade
9 questions
Scratch Vocabulary

Quiz
•
3rd Grade - University
10 questions
Quiz - DOM

Quiz
•
9th - 12th Grade
12 questions
RO81 LO1 Mind maps and visualisations

Quiz
•
9th - 11th Grade
12 questions
Mini Test 2 (Network Topologies)

Quiz
•
9th - 11th Grade
8 questions
R081 Mood Boards

Quiz
•
9th - 11th Grade
12 questions
REVISION 1

Quiz
•
11th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade