标签:turn csharp return int har ret blog arch sea
private int BinarySearch(List<int> list,int value) { int low = 0; int high = list.Count - 1; int middle = 0; while(low<=high) { middle = (high-low)/2+low; if(list[middle]>value) high = middle-1; else if(list[middle]<value) low = middle+1; else return middle; } return -1; }
标签:turn csharp return int har ret blog arch sea
原文地址:http://www.cnblogs.com/binglangwu/p/6698369.html