vendredi 3 avril 2020

What is the Time Complexity of std::multiset::count in C++?

I am confused about the number of operations that takes place when calling count(x) for some element x in a multiset of size n.

Am I correct that the number of operations is log(n) + #_of_matches_of_x, meaning logarithmic in the number of elements in the multiset, plus the number of matches of the target element x among all elements in the multiset?

Thanks for your time!

Aucun commentaire:

Enregistrer un commentaire