Increases the capacity of this list instance, if necessary.
Increases the capacity of this list instance, if necessary.For array lists this method ensures that the list can hold at least the number of elements specified by the minimum capacity argument.
For linked lists this method does nothing, it justs returns the value of parameter minCapacity.
If the list is an array list and if the capacity is actually increased, this method has a memory and time complexity of O(N), with N being the new capacity of the list.
In all other cases this method has a time complexity of O(1).