Which optimized pattern solves this lesson cleanly?
Practice this question from Shortest Path in Unweighted Graph - BFS Distance Pattern Practice Quiz, with options and an explanation.
Question
Which optimized pattern solves this lesson cleanly?
Option A — Correct answer
BFS distance over an adjacency list.
Option B
Nested loops without visited state
Option C
Two pointers on a sorted array
Option D
Character frequency counting only
Explanation
BFS distance over an adjacency list.