← Quiz: Matrix Traversal: all 13 questions
Quiz: Matrix Traversal · Question 3 of 13
How do you rotate a square matrix 90° clockwise in place?
How do you rotate a square matrix 90° clockwise in place?
- A.Reverse each row, nothing else
- B.Transpose it, then reverse every row
- C.Transpose it twice
- D.Sort every column
Answer & explanation
Correct answer: Transpose it, then reverse every row
Transposing turns rows into columns; reversing each row then gives the clockwise rotation.
Can you get the rest right without peeking?
Take the timed Quiz: Matrix Traversal quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →