请问我编写的这个二分查找程序为啥没有任何输出呢?
public class Search01 {
public static void main(String[] args) {
int[] array = {1,3,24,35,55,65,71,90,92,98,100};
int t = 92;
int i = search(array, t);
System.out.println(i);
}
public static int search(int[] array,int t){
int l = 0;
int r = array.length-1;
int m = (l+r)/2;
while(l <= r){
if(array[m] == t){
return m;
}else if(array[m] < t){
l = m + 1;
}else if(array[m] > t){
r = m - 1;
}
}
return -1;
}
}