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).

Binary Tree Inorder Traversal

trees
4261357
result =[]
Current callOn the call stackBeing visitedVisited

Ready.

Recursively visits the left subtree, then the node itself, then the right subtree (Left → Root → Right). On a Binary Search Tree this produces the values in sorted order. Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.

1 / 67

Execution

Step

1 / 67

Line (JavaScript)

—

RECURSION_CALL

Variables

node4
result[]
recursion depth1
Call stackdepth 1
inorder(4)← running

Operation counters

Recursive calls

1

Memory (measurable)

Call-stack frames1
Result list size0
Auxiliary spaceO(h) for recursion

Data structure state

result = []