I've been researching to find a faster alternative to list. In an algorithm book, hashtable
seems to be the fastest using separate chaining. Then I found that java has an implementation of hashtable
and from what I read it seems to it uses separate chaining. However, there is the overhead of synchronization so the implementation of hashmap
is suggested as a faster alternative to hashtable
.
My queations are:
- Is java
hashmap
the fastest data structure implemented in java to insert/delete/search? - While reading, a few posts had concerns about the memory usage of
hashmap
. One post mentioned that an emptyhashmap
occupy 300 bytes. Ishashtable
more memory efficient thanhasmap
? - Also, is the
hash
function in each the most efficient forstrings
?