Which optimized pattern solves this lesson cleanly?
Practice this question from Connected Components - Adjacency DFS Pattern Practice Quiz, with options and an explanation.
Question
Which optimized pattern solves this lesson cleanly?
Option A — Correct answer
Adjacency list plus DFS from every unseen node.
Option B
Nested loops without visited state
Option C
Two pointers on a sorted array
Option D
Character frequency counting only
Explanation
Adjacency list plus DFS from every unseen node.