Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int binary_serach(){
- int l,r;
- //l points to true, and r points to false
- while(r-l>1){
- int mid=(l+r)/2;
- if(f(mid))
- l=mid;
- else r=mid
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement