
#matrix
Shlyan
这个作者很懒,什么都没留下…
展开
-
[Leetcode] 240. Search a 2D Matrix II
Problems: https://leetcode.com/problems/search-a-2d-matrix-ii/ Solution: 鉴于matrix的特性,binary search已经不适用,为了迭代方便,从逆对角线的两端下手(任意选一端即可) class Solution { public boolean searchMatrix(int[][] matrix, int ...原创 2019-10-16 07:04:54 · 94 阅读 · 0 评论 -
[LeetCode] 74. Search a 2D Matrix
Problems: https://leetcode.com/problems/search-a-2d-matrix/ Solution1: class Solution { public boolean searchMatrix(int[][] matrix, int target) { // 矩阵为空,需要注意的是depth和width都需要判断 if(mat...原创 2019-10-16 05:23:34 · 131 阅读 · 0 评论