Simpler to code.
No effective alternative for unordered keys.
Faster for simple keys (a few arithmetic ops versus log N compares).
Better system support in Java for strings (e.g., cached hash code).
Stronger performance guarantee.
Support for ordered ST operations.
Easier to implement compareTo() correctly than equals() and hashCode().
Red-black BSTs: java.util.TreeMap, java.util.TreeSet.
Hash Tables: java.util.HashMap, java.util.IdentityHashMap.
Last updated 4 years ago