Sets the size of a list.
Sets the size of a list.Truncates the list if necessary.
If the size is increased, the new elements are initialized with NULL.
This method has a time complexity of O(N), with N being the difference between the old and new size of the list.