64 views

Consider a hash table with chaining scheme for overflow handling:

1. What is the worst-case timing complexity of inserting $n$ elements into such a table?
2. For what type of instance does this hashing scheme take the worst-case time for insertion?
edited | 64 views

1.) The worst case can be O(n) if all the insertions collide at the same key.

2.) This happens when we are not using an uniformly distributed hash function or when our hash table has only a single key where all the elements are chained up.