代码:
//从右上角开始查找
public class Solution {
public boolean Find(int target, int [][] array) {
if(array == null )
return false;
//将二维数组置于第四坐标系
int x = array[0].length - 1;
int y = 0;
while(x >= 0 && y < array.length){
if(array[y][x] == target)
return true;
if(array[y][x] > target){
x = x-1;
}else if(array[y][x] <target){
y = y + 1;
}
}
return false;
}
}