Binary Tree Playground

Build a Binary Tree from Traversals

Provide any two traversals (inorder, preorder, postorder) and we will reconstruct the tree, visualize it, and generate the missing traversal alongside an explanation of the structure.

Enter Traversal Orders

Separate values with commas or spaces.

Exactly two fields must be filled. Traversals should have unique node labels (letters, words, or numbers).

Tree Visualizer

Nodes are laid out using an inorder-based spacing for readability.

Build a tree to see the visualization.

Tree Explanation

Understand how the nodes connect in the reconstructed tree.

Once the tree is created, a structural walkthrough appears here.