Skip to content

Instantly share code, notes, and snippets.

View gasperlf's full-sized avatar
🎮
Focusing

Lewis Florez Renza gasperlf

🎮
Focusing
View GitHub Profile
@gasperlf
gasperlf / big-o-java-collections.md
Created January 4, 2023 12:34 — forked from FedericoPonzi/big-o-java-collections.md
Big O notation for java's collections

The book Java Generics and Collections has this information (pages: 188, 211, 222, 240).

List implementations:

                      get  add  contains next remove(0) iterator.remove
ArrayList             O(1) O(1) O(n)     O(1) O(n)      O(n)
LinkedList O(n) O(1) O(n) O(1) O(1) O(1)