Learn
Practice
Newsletter
Resources
Resume
New
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Search in 2D Matrix
Bookmark
Input
Example 1 (found)
Example 2 (not found)
Larger matrix
Single element (found)
Single element (not found)
Custom
matrix
=
[[1,3,5,7],[10,11,16,20],[23,30,34,60]]
,
target
=
3
1
3
5
7
10
11
16
20
23
30
34
60
algo
master
.
io
Step:
Start: Binary search on 2D matrix
Variable
Value
matrix
Matrix(3x4) [[1,3,5,7]...]
target
3
m
-
n
-
left
-
Variable
Value
right
-
mid
-
row
-
col
-
0 / 9
Input
Example 1 (found)
Example 2 (not found)
Larger matrix
Single element (found)
Single element (not found)
Custom
matrix
=
[[1,3,5,7],[10,11,16,20],[23,30,34,60]]
,
target
=
3
0 / 9
1
3
5
7
10
11
16
20
23
30
34
60
algo
master
.
io
Step:
Start: Binary search on 2D matrix
Visualization
Variables