Recall & Review
beginner
What is a connected component in an undirected graph?
A connected component is a group of nodes where each node is reachable from any other node in the same group through edges.
Click to reveal answer
beginner
How does BFS help in finding connected components?
BFS explores all nodes reachable from a starting node, marking them as visited. This helps identify one connected component at a time.
Click to reveal answer
beginner
What data structure is commonly used to implement BFS?
A queue is used to keep track of nodes to visit next in BFS.
Click to reveal answer
intermediate
In BFS for connected components, what do you do when you find an unvisited node?
Start a BFS from that node to find and mark all nodes in its connected component.
Click to reveal answer
intermediate
Why do we need to check all nodes in the graph when finding connected components?
Because the graph may have multiple disconnected parts, and BFS from one node only finds one connected component.
Click to reveal answer
What does BFS use to keep track of nodes to visit next?
✗ Incorrect
BFS uses a queue to explore nodes level by level.
What is the main goal of BFS when finding connected components?
✗ Incorrect
BFS visits all nodes reachable from a start node, identifying one connected component.
If a graph has 3 connected components, how many BFS runs are needed to find them all?
✗ Incorrect
Each BFS run finds one connected component, so 3 runs for 3 components.
What do you do when BFS finishes exploring one connected component?
✗ Incorrect
To find all components, start BFS from unvisited nodes after each BFS finishes.
Which graph type is suitable for connected components using BFS?
✗ Incorrect
Connected components are usually defined for undirected graphs.
Explain step-by-step how BFS is used to find connected components in an undirected graph.
Think about visiting nodes layer by layer and marking them.
You got /5 concepts.
Describe why BFS alone from one node does not find all connected components in a graph.
Consider what happens if the graph has isolated groups.
You got /4 concepts.