One root.
A world of connections.
Build the structure. Explore the relationships. Follow every step.
Think deeper.Unweighted · Undirected · 1-based
Keyboard: Tab to a vertex or edge. Enter/Space selects or applies the current tool; choose Connect and activate both vertices to connect. Arrows move a vertex; Delete removes the selection in Build mode; Escape cancels. In Build → Add, N adds a vertex. Ctrl/Cmd+Z undoes. Use F to fit and +/− to zoom.
A small tree. A good question.
The ancestor jump table
up[v][k] is the 2ᵏ-th ancestor of v. Zero means no ancestor. Click a row to inspect its vertex; the highlighted cell is the current jump.
Conventions, controls, and correctness
These are unweighted, undirected trees. Labels start at 1; new vertices take the next available label above the current maximum. One vertex is a valid tree; an empty canvas is not. Forest editing is allowed, but tree algorithms require connectivity. A rooted leaf has no children; the center algorithm instead starts from vertices of undirected degree at most one.
Binary shape properties require explicit left/right slots. Generating a binary tree defines these slots. Structural edits clear them; changing to a different root hides them because left/right orientation no longer applies. Re-select the original root to recover unchanged relationships. Balanced Binary Tree divides remaining vertices evenly; Complete Binary Tree fills each level from left to right.
Keyboard: Delete/Backspace removes the Build selection; arrows move a selected vertex; Ctrl/Cmd+Z undoes; Shift+Ctrl/Cmd+Z redoes; F fits; +/− zooms. The canvas must have focus. On touch screens choose Pan, or drag a vertex directly. All algorithm frames are generated by real traversals and restored exactly when stepping backward.
References: Binary lifting and LCA ↗ · Rooted tree terminology ↗