2.1 Rules

A heap, in general, is a tree with some special properties. The basic requirement of a heap is that the value of a node must be greater than or equal to the values of its children. A heap also has the additional property that all leaves be n or n1 levels from the root for some n > 0.

The last requirement of a heap is that all leaves of the bottom level of the tree are fill from one side to another. This concept will be explained more clearly after nodes are serialized in the following section.