Java collections – performance (Time Complexity)
A list is an ordered collection of elements.
Add Remove Get Contains Data StructureArrayList O(1) O(n) O(1) O(n) ArrayCopyonWriteArrayList O(n) O(n) O(1) O(n) ArrayLinkedList O(1) O(1) O(n) O(n) Linked List