HashMap
#
Basics- Simple hash table, Keys and Values are not ordered
- get(), remove() are constant time
- put() costs O(1) on average, O(n) when collision happens
- iteration order is not predictable, as the keys are not sorted
- allow both keys and values to be null
#
TreeMap vs HashMap- TreeMap are naturally sorted by order of key, HashMap is not: