Basic Binary Search-Tree Operations
The space below allows you to interactively try out
several basic operations on a binary search tree:
- Typing a number into the
“Value to insert” box (followed by “Enter”) adds it to the tree.
- Double-clicking a tree node removes it from the tree.
- Clicking on a node and its parent in succession performs a left or
right rotation around the parent node.
You can back up or redo an operation using the “<<” and
“>>” buttons.
Tree nodes that become unreachable (“garbage”) fall out of the
demonstration space.