DSAVisualiseData Structures & Algorithms Studio
Graphs & Connectivity Medium

Directed Graph (Adjacency List)

A digraph stores outgoing neighbors in insertion order; reversing it swaps every edge direction.

Trace input

Bounded JSON

Edit the lesson input, then build a deterministic source-linked trace.

This lesson validates its own input and operation limits.

Source scenarios

Complexity

BestΘ(V + E)
AverageΘ(V + E)
WorstΘ(V + E)
SpaceΘ(V + E)

Array state

Follow the active comparisons and writes.

Live snapshot

Current operation

Trace state
Ready 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

Java
Digraph.javaStep linked
The highlighted line follows the current step.

Ready to begin

Press Play to see what happens.

Detailed execution
Snapshot 1 / 1