Inorder Tree Traversal

Left -> Root -> Right recursion visualizer

Read Here
Step0/35
Visited0
Back To Trees List

Python Code

10
11 def recursiveInorder(self, root, arr):
12 # Base case: no node to process
13 if root is None:
14 return
15 self.recursiveInorder(root.left, arr)
16 arr.append(root.val)
17 self.recursiveInorder(root.right, arr)
18 # All done: left visited, root recorded, right visited → implicit return.
19

Tree Structure

Unvisited
Entering Frame
Exploring Left
Recording Value
Exploring Right
Done ✓
1234567

Traversal Progress

Current Node

-

Phase

Enter Function

Result Array

Traversal result appears here...
Enter: inorder(node=1)

Recursion Stack

Stack is empty. Click Next to begin!

Step Explanation

Ready to Start Traversal

Click "Next Step" to walk through the Inorder Traversal step-by-step (Left → Root → Right).

  • Code starts execution from recursiveInorder(root, arr).
  • Watch the tree node highlights and call stack update together.