algoritmauzmanı
Sign in
TREN
Subtopic 7.2

Heap with Linked Nodes

5lessons33 min0done

A heap can also be built from linked nodes. Besides its left and right children, every node points to its parent, because sift up walks up the tree. The next free place is found by following the binary form of the number of elements.

The operations from the array lessons are repeated in the same order with the same names. The last lesson compares the two versions and shows why heaps are usually written with an array.

Lesson 7.2.1 A heap of nodes: parent and the last place7 min