The advantage of a hash table is that random access, insertion and deletion can be performed in O(1) (or at least with a strong bias towards it) while an array has a O(log N) complexity for these tasks. However, a array is good if you access known indexes all the time and don't care about insertion and deletion, the complexity for this is guaranteed O(1), best case, average case and worst case. Plus, arrays maintain a order and can be sorted, but you don't need this all the time.
A common use case for hash tables are dictionaries of any kind (for example just as a lookup table) and a data store where you don't need to maintain an order.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com