Frees the priority queue's memory from heap.
Frees the priority queue's memory from heap.Note: The memory of the elements themselves is not freed.
This function has a time complexity of O(N), with N being the number of elements in the priority queue.