0074. 搜索二维矩阵 #119
Replies: 1 comment
-
因为题中说每行的第一个整数大于前一行的最后一个整数,所以可以先按照行进行二分确定行的位置,再对行进行二分确定列的位置这样的时间复杂度也是O(log(M)+log(N)),感觉更容易理解一些 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
0074. 搜索二维矩阵
标签:数组、二分查找、矩阵; 难度:中等; 题目链接 0074. 搜索二维矩阵 - 力扣 (https://leetcode.cn/problems/search-a-2d-matrix/); 题目大意 描述:给定一个$m \times n$ 大小的有序二维矩阵 $matrix$ 。矩阵中每行元素从左到右升序排列,每列元素从上到下升序排列。再给定一个目...
https://algo.itcharge.cn/Solutions/0001-0099/search-a-2d-matrix/
Beta Was this translation helpful? Give feedback.
All reactions