Tree Visualizer

Build binary trees and step through traversals

Runs on this device

Comma-separated values, LeetCode style

Visualization

Value: 1 Depth: 0 Height: 2 Balance Factor: 01Value: 2 Depth: 1 Height: 1 Balance Factor: -12Value: 5 Depth: 2 Height: 0 Balance Factor: 05Value: 3 Depth: 1 Height: 1 Balance Factor: -13Value: 7 Depth: 2 Height: 0 Balance Factor: 07

Algorithms

Output log

Select an algorithm to start visualization

What does the Tree Visualizer show?

Tree Visualizer draws binary trees from a level-order array or binary search tree insertions, animates pre-order, in-order, post-order and level-order traversals, and exports SVG or PNG.

What array format does it accept?

Comma separated numbers in level order, null for a missing child, brackets optional. Values under a null parent are errors; the maximum is 255 nodes.

How are search tree duplicates treated?

They are ignored. Switching to search tree mode reinserts the values on screen, which removes duplicates and may change the tree's shape.