![]() The rehash operation, which is O(n), can at most happen after n/2 ops, which are all assumed O(1): Thus when you sum the average time per op, you get : (n*O(1) + O(n)) / n) = O(1).It is very rare that many items will be hashed to the same key [if you chose a good hash function and you don't have too big load balance.However, it is said to be O(1) average and amortized case because: ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |