every node is higher than (or equal tothat of all its descendants oras complete binary tree for which the priorities become smaller along every path down through the tree the most obvious difference between binary heap tree and binary search trees is that the biggest number now occurs at the root rather than at the right-most node secondlywhereas with binary search treesthe left and right sub-trees connected to given parent node play very different rolesthey are interchangeable in binary heap trees three examples of binary trees that are valid heap trees are and three which are not valid heap trees are the first because violates the required priority orderingthe second because it is not perfectly balanced and hence not completeand the third because it is not complete due to the node on the last level not being as far to the left as possible basic operations on binary heap trees in order to develop algorithms using an array representationwe need to allocate memory and keep track of the largest position that has been filled so farwhich is the same as the current number of nodes in the heap tree this will involve something likeint max int heap[max+ int /maximum number of nodes allowed /stores priority values of nodes of heap tree /largest position that has been filled so far for heap trees to be useful representation of priority queueswe must be able to insert new nodes (or customerswith given prioritydelete unwanted nodesand identify and remove the top-priority nodei the root (that is'servethe highest priority customerwe also need to be able to determine when the queue/tree is empty thusassuming the priorities are given by integerswe need constructormutators/selectorsand conditioninsert(int parray heapint ndelete(int iarray heapint nint root(array heapint nboolean heapempty(array heapint nidentifying whether the heap tree is emptyand getting the root and last leafis easy