Joins the two priority queues by moving all elements of the 'other' queue.
Joins the two priority queues by moving all elements of the 'other' queue. 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 queue after the join.