d-heaps

Published

2023-08-05

d-Heaps are heaps where a node can have up to d children. For example, we can have a 3-heap, a 4-heap, a 5-heap and so on. A binary heap is, in fact, a d-heap where d = 2. All the same properties must hold—a d-heap must have the heap order property and it must have the structure property—just like binary heaps.

There are some differences, though, for example how we calculate parent and child indices in the array representation of a d-heap.

Here’s a brief video outlining their properties:

Supplemental reading

Resources

Comprehension check

  1. True or false: A binary heap is a d-heap with d=2.
  2. In a 4-heap, there can be up to _______ nodes in the second level below the root.
  3. We can find the index of any non-root element in the array representation of a d-tree by calculating $x / 2. If i is the index of the element, what is the value of x?

Answers: Ɩ - ᴉ ’9Ɩ ’ǝnɹʇ

Original author: Clayton Cafiero < [given name] DOT [surname] AT uvm DOT edu >

No generative AI was used in producing this material. This was written the old-fashioned way.

All materials copyright © 2020–2023, The University of Vermont. All rights reserved.