Returns a shallow copy from this list of all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
Returns a shallow copy from this list of all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.For array lists cloning has a time complexity of O(M), with M being the number of elements cloned.
For linked lists cloning from the beginning or the end of the list has a time complexity of O(M) with M being the number of elements cloned, while cloning from a random position in the middle of the list has a time complexity of O(N) with N being the number of elements in the list.
This method has a memory complexity of O(M), with M being the number of elements cloned.