Binary Tree Visualiser

A binary search tree visualizer: search, insert, delete, traversals and classic interview questions like height, balance and LCA, one step at a time.

A frontend app built by Ananda Rizki. More of them at Labs.

Labs — by Ananda Rizki

Binary Tree Visualiser

Simulator

Sixteen operations on a binary search tree, stepped one comparison at a time: search, insert, delete with its awkward two-child case, invert, the four traversals, and eight questions asked about a tree rather than done to one — height, balanced, longest path, mirror image, valid search tree, path sum, kth smallest, lowest common ancestor. Those last eight are grouped together because they are one idea underneath: a fold from the leaves upward, where a node cannot answer until both children have, and the badge under each node is that node's returned value. A frame is a whole snapshot of the tree rather than a diff, and node ids are stable across frames, so the diagram animates instead of blinking when an operation replaces the root.

Built with
  • react
  • tailwind
Related

Built by Ananda Rizki, a software engineer and designer, one of the small web apps he writes for fun.

Explore more apps on Labs