(List<Integer> ls, int target)
| 22 | } |
| 23 | |
| 24 | private int BinarySearch(List<Integer> ls, int target){ |
| 25 | int l = 0; |
| 26 | int r = ls.size(); |
| 27 | |
| 28 | while(l < r){ |
| 29 | int m = l + (r-l)/2; |
| 30 | if(target < ls.get(m)) |
| 31 | r = m; |
| 32 | else |
| 33 | l = m + 1; |
| 34 | } |
| 35 | return l; |
| 36 | } |
| 37 | } |
no test coverage detected