Good afternoon, I am wondering what the time complexity of std::multimap::equal_range
is? Is it Big-O(n) or BIG-0(log n). I remember reading that the time complexity of std::multimap::erase
"is logarithmic plus linear time for the length of the sequence being removed." <http://frank.mtsu.edu/~csjudy/STL/Multimap.html>
C++03 standard, Table 69 ("Associative container requirements") in 23.1.2 says that equal_range
has logarithmic complexity.
equal_range
is an O(log n) operation returning the pair of lower_bound
and upper_bound
.
This means it will return an iterator range starting with the first key that is greater-than or equal-to the search key and ending with the first key that is greater than the search key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With