d-ary Heap
A heap where each node has d children; shallower, cheaper decrease-key, costlier extract.
Decision · step 2 of 6D-ary Heap: Heapify with three children per node
Heapify: slot 2 holds 8; its children are slots 7, 8, 9, that is 3 x 2 + 1 onward, holding 3, 19, 9. The smallest child is 3, found with 2 comparisons. 8 is larger, so they swap and the sift continues from slot 7.
What you will see
Wider tree; sift-down compares against d children.
Cost
| insert | O(log_d n) |
|---|---|
| extract top | O(d log_d 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.