Hash Tables

Summary

Examples

Time Complexity

A good hash table will complete searching, inserting, and deleting in O(1) and spacing in O(n). The worst case scenario is when every insertion causes a hash collision and the table has to resort to a linear search, in which case the time commplexity becomes O(n). The speed of hash tables gives it a great advantage over other data structures. However, when the size of data is not very large, hash tables become higher cost to implement.

Common Interview Questions

Other Resources

https://www.youtube.com/watch?v=KyUTuwz_b7Q