Difference in these two ways of using lower_bound [C++]
Difference between en1 and en2, changed 108 character(s)
I have a set as<br>↵
set\<int\> s;<br>↵
I used lower_bound(s.begin(),s.end(),x)<br>↵
It gave me TLE.<br>↵
Th
en i used s.lower_bound(x)<br>↵
My solution passed.<br>↵
Whats the difference in both? I mean why is it happening?
<br>↵
First one is working in O(n) time while latter in O(logn).<br>↵
Weren't both supposed to be O(logn) ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English root8950 2015-09-27 09:51:40 108
en1 English root8950 2015-09-27 09:49:46 276 Initial revision (published)