Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Spiral Matrix
Bookmark
Input
3x3 Matrix
3x4 Matrix
2x2 Matrix
4x5 Matrix
Single Row
Single Column
Custom
matrix
=
[[1,2,3],[4,5,6],[7,8,9]]
1
2
3
4
5
6
7
8
9
algo
master
.
io
Step:
Start: Traverse matrix in spiral order
Variable
Value
matrix
Matrix(3x3) [[1,2,3]...]
result
-
top
-
bottom
-
Variable
Value
left
-
right
-
row
-
col
-
0 / 19
Input
3x3 Matrix
3x4 Matrix
2x2 Matrix
4x5 Matrix
Single Row
Single Column
Custom
matrix
=
[[1,2,3],[4,5,6],[7,8,9]]
0 / 19
1
2
3
4
5
6
7
8
9
algo
master
.
io
Step:
Start: Traverse matrix in spiral order
Visualization
Variables