Graphs & Connectivity Medium
Directed Graph (Adjacency List)
A digraph stores outgoing neighbors in insertion order; reversing it swaps every edge direction.
Trace input
Bounded JSONEdit the lesson input, then build a deterministic source-linked trace.
Source scenarios
Complexity
BestΘ(V + E)
AverageΘ(V + E)
WorstΘ(V + E)
SpaceΘ(V + E)
Array state
Follow the active comparisons and writes.
Current operation
Trace stateReady to explore
Source behavior & common mistakes
Build the directed adjacency lists and their reversed graph.
- Treating a directed edge as symmetric.
- Reordering adjacency entries while reversing.
Algorithm code
JavaDigraph.javaStep linked
The highlighted line follows the current step.
Ready to begin
Press Play to see what happens.
Detailed execution
Snapshot 1 / 1