In Java Collection Framework, a lot of implmentations mention about their performance in the Javadoc. For example, HashSet's says:
This class offers constant time performance for the basic operations (add, remove, contains and size), assuming the hash function disperses the elements properly among the buckets. Iterating over this set requires time proportional to the sum of the HashSet instance's size (the number of elements) plus the "capacity" of the backing HashMap instance (the number of buckets).
And ArrayList's says:
The size, isEmpty, get, set, iterator, and listIterator operations run in constant time.
But LinkedList's says nothing about its performance.
I believe pop
and push
method of LinkedList runs in constant time as linked list in computer science does. But I'm worry that It is okay to suppose that when I implement a method which has a LinkedList parameter.
Does LinkedList has any reason not to say its performance?