Save
Computer Science
algorithms
graph & tree traversal
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
willow
Visit profile
Cards (12)
What is the process of graph traversals?
Systematically visiting each
node
in the graph
View source
Why is it important to track visited nodes in graph traversals?
To avoid revisiting nodes and
infinite loops
View source
What are the three states for each node in graph traversals?
Unvisited
Discovered
Visited
View source
What is the primary use of breadth-first search in graph traversal?
To find the path with the
least nodes
View source
What data structure does breadth-first search use?
A
queue
View source
How does breadth-first search explore nodes?
It explores all
adjacent
nodes before moving on
View source
What is the main purpose of depth-first search?
To determine if a
path
exists between two
nodes
View source
What does it mean for a graph to not be fully connected?
Some
nodes
may not have
direct paths
to others
View source
How does depth-first search proceed through the graph?
It searches as far down a
branch
as possible
View source
What happens if the target node is not found during depth-first search?
The algorithm
backtracks
to explore other branches
View source
What data structure does depth-first search use?
A
stack
View source
What is added to the stack during depth-first search?
Each discovered
node
View source