Hello everyone, I hope you are doing well,↵
can anybody explain to me why this code costs O(n) on sets and multiset but in the other side it costs O(log(n)) on the sorted vectors.↵
↵
the code -> ↵
↵
multisetst ms; int x ; ↵
auto it = upper_bound(ms.begin() , ms.end() , x) ;↵
↵
↵
↵
between this code cost O(log(n))↵
auto it = ms.upper_bound(x);
can anybody explain to me why this code costs O(n) on sets and multiset but in the other side it costs O(log(n)) on the sorted vectors.↵
↵
the code -> ↵
↵
multiset
auto it = upper_bound(ms.begin() , ms.end() , x) ;↵
↵
↵
↵
between this code cost O(log(n))↵
auto it = ms.upper_bound(x);