Topological Sort pattern
Kahn’s algorithm uses indegrees and a queue; DFS uses reverse finishing order. Both expose dependency-respecting sequences.
Difficulty: Hard · Approach: Visible frontier and visited order
This is a public lesson preview. Sign in with a Lifetime Pass to open the protected animation, solution, and code.