Please enable JavaScript.
Coggle requires JavaScript to display documents.
MM9 - Coggle Diagram
MM9
Heap
properties of heaps
-
A heap can be implemented as an array by recordind its elements in the top-down, left-to-right fashion.It is convenient to store the heaps's elements in positions 1 through n of such an array,leaving H[0] either unused or putting there a sentinel whose value is greater than every elementi in the heap.In such a representation.
the parental node keys will be in the first [n/2] positions of the array,
while the leaf keys will occupy the last [n/2] positions
the children of a key in the array's parental position i (1<= i <=[n/2]) will be in position 2i and 2i + 1,and, correspondingly,the parent of a key in position i (2<= i <= n) will be in position [i/2]
-
There exists exactly one essentially complete binary tree with n nodes. Its
height is equal to [log2 n]
-
-
The parental dominance or heap property—the key in each node is greater
than or equal to the keys in its children.
-
-
-