jeudi 22 juin 2017

Does std::unordered_set take constant lookup time for any object regardless of the predicate?

In std::unordered_set, we provide a predicate to indicate whether two objects A and B are equal or not. My question is, suppose that we need O(k) time to determine if A and B are equal or not. Does the unordered_set::find still take amortized constant time or does it take amortized O(k) time?

Aucun commentaire:

Enregistrer un commentaire