Skip to content
DSA Visualizerpreview

In-order traversal

Left subtree, the node, right subtree: on a search tree this reads the values in sorted order.

O(n) time · O(height) for the recursion space

Values50, 30, 70, 20, 40, 60, 80

The tree built from 50, 30, 70, 20, 40, 60, 80. Visit every node in-order.

Tree with 7 nodes; in order: 20, 30, 40, 50, 60, 70, 80. Visited so far: none.
  • compare
  • swap or write
  • settled

1 / 16

Speed

Space play · ← → step · Home End jump · drag the strip to scrub