Returns the element at the specified position in this list.
Returns the element at the specified position in this list.For array lists this method has a time complexity of O(1).
For linked lists this method has a time complexity of O(N), with N being the minimum of the differences between index and 0 or index and the size of the list. Therefore retrieving the first or last element has a time complexity of O(1), but retrieving a random element from the list has O(N).