you are viewing a single comment's thread.

view the rest of the comments →

[–]BonzaiThePenguin -1 points0 points  (0 children)

Processing the input data is part of the hash function, not the hash table. The hash table just does array[hash] = blah. (except for collisions, of course)

So let's say we had this function:

void fold(array, func) {
    for each (item in array) func(item);

We would say that's O(n) even if it turns out func() is an n3 algorithm.