Algorithm for merging two max heaps?
It depends on what the type of the heap is. If it’s a standard heap where every node has up to two children and which gets filled up that the leaves are on a maximum of two different rows, you cannot get better than O(n) for merge. Just put the two arrays together and create … Read more