DSA-VerseLearn by watching code run
DashboardData StructuresAlgorithmsVisualizerCORECoding PlaygroundInterview QuestionsComplexity AnalyzerLearning NotesBookmarksLearning ProgressSettings
Instrumented JavaScript implementation · lines sync with the animation

Run to execute this JavaScript code for real (output appears here).

Graph BFS (Breadth-First Search)

graphs
ABCDEFG

Queue (front → rear)

empty

Traversal order

—
Current vertexIn queueDiscoveredProcessedUnvisited

Ready.

Explores the graph level by level using a queue. Because vertices are discovered in order of distance, BFS also finds the shortest path (fewest edges) from the start in an unweighted graph. Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.

1 / 78

Execution

Step

1 / 78

Line (JavaScript)

—

FUNCTION_CALL

Variables

—

Call stackdepth 0

main (no active function frames)

Operation counters

No counted operations yet.

Memory (measurable)

Queue size0
Visited set size0
Auxiliary spaceO(V)

Data structure state

order = []