Increases the capacity of the heap, if necessary.
Increases the capacity of the heap, if necessary.This function ensures that the heap can hold at least the number of elements specified by the minimum capacity argument.
If the capacity is actually increased, this function has a memory and time complexity of O(N), with N being the new capacity of the heap.