Back to problems

2-D Matrix Transpose with Memory-Layout Discussion

Algorithm · NVIDIA · Medium

Examples Example 1 Example 2 Requirements Create a transpose operation for a two-dimensional matrix. Possible interfaces: Core requirements: The value found at a[j][i] must appear in the result at index [i][j]. The version that creates a new matrix must work for both empty and rectangular inputs. When the matrix is square, provide an in-place approach that exchanges entries only when i > does not guarantee the same layout as one contiguous flat buffer. Review the row-major…

Checking your access…