binary heap the implementation we will use is known as binary heap its use is so common for priority queue implementations thatin the context of priority queueswhen the word heap is used without qualifierit is generally assumed to be referring to this implementation of the data structure in this sectionwe will refer to binary heaps merely as heaps like binary search treesheaps have two propertiesnamelya structure property and heaporder property as with avl treesan operation on heap can destroy one of the propertiesso heap operation must not terminate until all heap properties are in order this turns out to be simple to do structure property heap is binary tree that is completely filledwith the possible exception of the bottom levelwhich is filled from left to right such tree is known as complete binary tree figure shows an example it is easy to show that complete binary tree of height has between and + nodes this implies that the height of complete binary tree is log which is clearly (log nan important observation is that because complete binary tree is so regularit can be represented in an array and no links are necessary the array in figure corresponds to the heap in figure figure complete binary tree figure array implementation of complete binary tree