🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Reverse each row, nothing else
  2. B.Transpose it, then reverse every row
  3. C.Transpose it twice
  4. 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 →