A developer is implementing a spiral traversal algorithm for a 2D matrix, starting from the top-left corner and moving clockwise. Given the matrix `[[1, 2, 3], [8, 9, 4], [7, 6, 5]]`, what is the correct sequence of visited elements?
-
A
1, 2, 3, 8, 9, 4, 7, 6, 5
-
B
1, 8, 7, 6, 5, 4, 3, 2, 9
-
C
1, 2, 3, 4, 5, 6, 7, 8, 9
-
D
1, 2, 9, 4, 5, 6, 7, 8, 3