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[row index][column index] of size 3x3 (rows x columns). 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:

The correctly functioning algorithm applied to the 2D array above yields the following transposed 2D array:

Short Answer4 MarksPremium

41 Uses68 Views2 Likes

Login or Create an Account to view the mark scheme, comment, and add to a test