2-3 Tree
A perfectly balanced search tree whose nodes hold one or two keys.
Decision · step 5 of 17B-Tree: A 2-3 tree grows by splitting
10 20 30 has 3 keys and the limit is 2, so it splits. The middle key, 20, moves up to the parent; the keys below it form the left node and the keys above it the right node.
What you will see
Overfull nodes split and push a key up; height grows only at the root.
Cost
| search | O(log n) |
|---|---|
| insert | O(log n) |
| delete | O(log n) |
| Space | O(n) |
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.
Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.