|
|
|
|
|
by paulddraper
1035 days ago
|
|
> it is trivial to construct an algorithm with this property Actually, it is impossible to construct an algorithm with this property, at least under any usual computational model. Every computational model has discrete time units; therefore the amount of time taken cannot be vanishingly small. (This is assuming the usual notion of complexity, where only the asymptotic behavior matters. It doesn't matter if it gets increasingly faster over the first million input sizes...it only matters what the behavior is as n -> infinity.) A program cannot be increasingly faster forever. |
|
Assume that you use a linkedlist for collisions, then for some growth rates, your cost of access is not constant, and is certainly at most O(n).
The point being that the universal hashing function has 1/m probability of collision; if your growthrate is bad. Then m << n, which turns the expected time from constant to at most O(N) because m grows slower than N.