We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There's a lot to be said about conflict in a hash table.
Most modern implementations combine a smart probing approach with storage reallocation when conflict rate increases. You can thus expect O(1) in most insert/lookup most of the time.
Of course, if you use a fixed size storage and solve conflicts with linked list of elements, things can go really wrong. But again, it depends on the storage size and the quality of the hash function.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
There's a lot to be said about conflict in a hash table.
Most modern implementations combine a smart probing approach with storage reallocation when conflict rate increases. You can thus expect O(1) in most insert/lookup most of the time.
Of course, if you use a fixed size storage and solve conflicts with linked list of elements, things can go really wrong. But again, it depends on the storage size and the quality of the hash function.