I have two binary min-heaps, where each one stores different keys. The trees are also complete binary trees. I want to merge these two into one binary min-heap of size exactly 2n. Preferably in O(long) time and O(1) space.
Asked
Active
Viewed 338 times
0
-
How are the heaps implemented? As arrays or as pointer-linked nodes? – trincot Oct 07 '21 at 17:11
-
Does this answer your question? [Algorithm for merging two max heaps?](https://stackoverflow.com/questions/1595333/algorithm-for-merging-two-max-heaps) – trincot Oct 07 '21 at 17:12