Re:Google Interview University – Plan for studying to become...
by dahart on Thursday October 06, 2016 @02:14PM
(#12654693)
Yep, and a hash table's get is O(1) amortized even when you include the hash function itself, simply because the hash function doesn't change as the hash table grows. @rand_r is right that the hash function is doing C * log2(MAX_N) operations, but that doesn't actually affect the big-O metric, it only affects the run time. :P
I usually think of hashtables though as being O(1) in referring to the look up(amortized) and not the hash code itself.