Joins the two heaps by moving all elements of the 'other' heap.
Joins the two heaps by moving all elements of the 'other' heap. When this function returns, 'other' will be empty.This function has a time complexity of O(N), with N being the number of elements in the heap after the join.