i need an explain for the complexity of this code 
Difference between en1 and en2, changed 4 character(s)
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 -> ↵

multiset 
st 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);

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Radiohead___ 2025-03-03 01:01:40 4 Tiny change: 'nmultiset st ; int x ; ' -> 'nmultiset ms; int x ; '
en1 English Radiohead___ 2025-03-03 01:00:22 393 Initial revision (published)