题解 | #二维数组中的查找#

二维数组中的查找

http://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e

public class Solution { public boolean Find(int t, int [][] a) { int x= a.length-1; for(int y=0;y>=0 && y<=a[0].length -1 && x>=0;){ if(a[x][y]==t) return true; else if(a[x][y]<t) y++; else x--; } return false; }

}

全部评论

相关推荐

07-17 12:09
门头沟学院 Java
讲的口干舌燥,头都晕了怎么要讲这么长啊
码农索隆:没事,你口干舌燥,他不一定会看,
投递小鹏汽车等公司7个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务