A heap data structure stored as a complete rooted tree with up to children per vertex, where . The final level is filled from left to right. For zero-based array storage, the parent of entry is , and its child number has index when that index is inside the active heap. There are at most levels containing entries.
A d-ary heap in which each parent key is no greater than each child key. Transitivity makes the root a minimum. Removing the root requires choosing a smallest child at each downward step, taking time in the usual range. Decreasing a key or inserting a new leaf only compares along one chain of parents, taking time in that range. These priority queue bounds assume constant-time key comparisons and available array capacity. An indexed priority queue must also update its item-to-index table after every swap.

Articles by others on the same topic (0)

There are currently no matching articles.