hashmap vs treemap vs linkedhashmap code example

Example 1: hashmap vs linkedhashmap

Main difference between HashMap and LinkedHashMap
I remember is that LinkedHashMap maintains
insertion order of keys, 
On the other hand HashMap doesn't maintain
any order or keys or values.
Also LinkedHashMap requires more memory than HashMap
because of the ordering feature.
LinkedHashMap doublly Linked List to 
maintain order of elements.

Example 2: treemap vs hashmap

- TreeMap doesn't have null key and keys are sorted
 Can contain only unique keys and keys are sorted in ascending order.
 
 v- HasHMap can have null key, order is not guaranteed

Tags:

Misc Example