Trims the capacity of the queue to the priority queue's current size.
Trims the capacity of the queue to the priority queue's current size.If the capacity is actually decreased, this function has a time complexity of O(N), with N being the number of elements in the priority queue.