there is T a binary tree, for each z node (not a leaf) we define
NPL(z) (null path length) as the length of the shortest path from the node to the leaf.
we add npl[z] to each node.
binary tree T is called left tree if npl[left[z]]>=npl[right[z]]
the left tree H is called left heap if for every node z
key[parent[z]]<=key[z]
k- represents the priority if the heap
there are two left heaps
H1 with n1 nodes and H2 with n2 nodes
the merging operation is defined as follwed:
we choose the heap with the largest key in the rood
and merge it (recursevly) with the right side of the other heap.
and rearange it so the product will be a "left tree"
???
and prove that the complexity of the code is theta(lg n1 +lg n2)
how i tried:
first of all, do i represent the heaps as arrays?