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>↵
Then 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) ?
set\<int\> s;<br>↵
I used lower_bound(s.begin(),s.end(),x)<br>↵
It gave me TLE.<br>↵
Then 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) ?