News for hackers. Stuff that matters.
Re:Finding unique items: hash vs. sort by BeeOnRope on Wednesday January 08, 2020 @02:34AM (#21989167)
Right, O(n).

O(1), hah, I wish!

Yes, there is the caveat of constant k, but in practice this is usually implied for integer keys e.g., the int32 integers used in the OP.

If the keys become arbitrarily long, hash tables also become O(n log k) since you have to hash and compare log k bits of key state.

There are no comments on this comment yet.