I have a private LinkedList in a Java class & will frequently need to retrieve the last element in the list. The lists need to scale, so I\'m trying to decide whether I
It is O(1) because the list is doubly-linked. It keeps references to both head and tail.
From documentation:
Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.