( , ( , ( , ( , ( , ( , ( , ( , ( , ( , ( , ( , ( ,wfigure example of heap storing entries with integer keys the last position is the one storing entry ( , the tree in figure is complete because levels and are fulland the six nodes in level are in the six leftmost possible positions at that level in formalizing what we mean by the leftmost possible positionswe refer to the discussion of level numbering from section in the context of an array-based representation of binary tree (in factin section we will discuss the use of an array to represent heap complete binary tree with elements is one that has positions with level numbering through for examplein an array-based representation of the above treeits entries would be stored consecutively from [ to [ the height of heap let denote the height of insisting that be complete also has an important consequenceas shown in proposition proposition heap storing entries has height log njustificationfrom the fact that is completewe know that the number of nodes in levels through of is precisely - and that the number of nodes in level is at least and at most therefore > and < + by taking the logarithm of both sides of inequality <nwe see that height <log by rearranging terms and taking the logarithm of both sides of inequality < + we see that log( < since is an integerthese two inequalities imply that log