Reputation: 86055
hash access time is best time O(1) and worst case O(n). I am wondering what's the average case?
Upvotes: 0
Views: 51
Reputation: 81
For a hash that isn't nearing full the average case is roughly O(1). The details depend a bit on how collisions are resolved and how full the hash is. Usually efficiency starts really decreasing around 80% capacity.
Upvotes: 2
Reputation: 3519
In practice, O(1). See http://en.wikipedia.org/wiki/Hash_table#Performance_analysis
Upvotes: 0