Data Structures & AlgorithmsHardTCS NQT · Accenture

A matrix has rows [1, 2, 3], [4, 5, 6], [7, 8, 9]. The matrix is transposed and then each row is reversed. What is the element in row 0, column 2 of the result?

  1. A. 1
  2. B. 2
  3. C. {C+8}
  4. D. 4

Correct answer: A. 1

Transposing gives rows [1,4,7], [2,5,8], [3,6,9]; reversing row 0 gives [7,4,1], so column 2 holds 1. Reversing before transposing gives a different matrix.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic