Hashtables

We covered the idea and basic implementation of a hashtable. We saw that insertion takes amortized constant time (meaning occasionally it takes linear time, but you can perform n insertions in O(n) steps). I explained that if you have a good random hash function then you can do lookup in O(1) expected time, but the worst case lookup time is O(n).