It's a newbie question: what is the big O for get/put/contains for LinkedHashMap? As I understand for TreeMap it's O(logN), and for LinkedList (to search/add/delete by value), it is O(N). Does that make LinkedHashMap operates on O(logN), or does it perform better? And how does compare with HashMap in terms for performance and memory usage, etc.?
LinkedHashMap
offers similar performance to those of HashMap (in terms of big O notation), but also allows a deterministic iteration by the order of insertion.
This means, get()
, put()
, contains()
, are all done in O(1)
(amortized average).
You can read more in the documentation.