InterviewSolution
Saved Bookmarks
| 1. |
What is the worst case time complexity of insert function in the hash table when the list head is used for chaining?(a) O(1)(b) O(n log n)(c) O(log n)(d) O(n)I want to ask this question from Hash Tables topic in section Hash Tables of Data Structures & Algorithms II had been asked this question in quiz. |
|
Answer» CORRECT option is (d) O(n) The best I can EXPLAIN: Worst case time complexity of insert function in the hash table when the list HEAD is used for chaining is O(n). It is caused when a number of COLLISIONS are very high. |
|