Learn
Practice
Newsletter
Resources
Resume
New
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Kth Smallest Element in Sorted Matrix
Bookmark
Input
Example 1 (3x3, k=8)
Example 2 (2x2, k=2)
4x4 matrix (k=5)
5x5 matrix (k=13)
Single element
Custom
matrix
=
[[1,5,9],[10,11,13],[12,13,15]]
,
k
=
8
1
5
9
10
11
13
12
13
15
algo
master
.
io
Step:
Start: Find kth smallest element in sorted matrix
Variable
Value
matrix
Matrix(3x3) [[1,5,9]...]
k
8
n
-
low
-
high
-
Variable
Value
mid
-
r
-
c
-
count
-
0 / 36
Input
Example 1 (3x3, k=8)
Example 2 (2x2, k=2)
4x4 matrix (k=5)
5x5 matrix (k=13)
Single element
Custom
matrix
=
[[1,5,9],[10,11,13],[12,13,15]]
,
k
=
8
0 / 36
1
5
9
10
11
13
12
13
15
algo
master
.
io
Step:
Start: Find kth smallest element in sorted matrix
Visualization
Variables