Method
searchMatrix
(int[][] matrix, int target)
Source from the content-addressed store, hash-verified
| 17 | return false; |
| 18 | } |
| 19 | public boolean searchMatrix(int[][] matrix, int target) { |
| 20 | |
| 21 | // Find the appropriate row |
| 22 | int n=matrix.length; |
| 23 | int m=matrix[0].length; |
| 24 | boolean result=false; |
| 25 | for(int i=0;i<n;i++) |
| 26 | { |
| 27 | if(target>=matrix[i][0] && target<=matrix[i][m-1]) |
| 28 | { |
| 29 | result=binSearch(matrix[i],target); |
| 30 | } |
| 31 | } |
| 32 | return result; |
| 33 | } |
| 34 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected