ProgrammingVery hard

The zigzag scan of the 3 x 3 matrix [[1,2,3],[4,5,6],[7,8,9]] along anti-diagonals, alternating direction (as in JPEG order), gives which sequence?

  1. A. 1 2 4 7 5 3 6 8 9
  2. B. 1 2 3 6 9 8 7 4 5
  3. C. 1 4 7 8 9 6 3 2 5
  4. D. 1 2 4 5 7 8 3 6 9

Correct answer: A. 1 2 4 7 5 3 6 8 9

The anti-diagonals are visited in order, and each one alternates direction, giving 1, 2, 4, 7, 5, 3, 6, 8, 9.

More C Programming questions

Exams that ask this topic