Login or Create an Account to view the mark scheme, comment, and add to a test
2D array transposition reflects array values across the top left to bottom right diagonal such that the row and column indices of each value in the array are swapped.
[4]
Construct an algorithm to efficiently transpose a 2D array called NUMBERS of size 3x3. NUMBERS must be transposed in-place, that is, the values in the original array must be replaced by the transposed values (a new array should not be created).
For example, consider the following 2D array:
Question Image
The correctly functioning algorithm applied to the 2D array above yields the following transposed 2D array:
Question Image

Short Answer4 MarksPremium
48 Uses116 Views2 Likes