Note that key values in a heap are ordered top down; i.e., a sequence of values on any path from the root to a leaf is decreasing (nonincreasing, if equal keys are allowed). However, there is no left-to-right order in key values; i.e., there is no relationship among key values for nodes either on the same level of the tree or,more generally, in the left and right subtrees of the same node.
Here is a list of important properties of heaps, which are not difficult to prove
- 1 more item...