//lowe_bound
// lower bound, return the first index that is equal ot larger than target
int lower_bound(int target, vector array){
Int l = 0;
Int r = array.size();
while(l < r){
Int m = l + (r - l) / 2;
if(array[m] < target){
l = m + 1;
}else{
R = m;
}
}
return l;
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Qiangiang/binary-search
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
quick snippet of code of binary search
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published