This question evaluates understanding of matrix manipulation and numerical linear algebra, including in-place matrix transforms and rotations, sparse matrix representations, eigenvalue computation, and their extensions to higher-order tensors.
You are given a square matrix A (size n × n).
A
into its transpose (mirror across the main diagonal). Prefer an
in-place
algorithm when possible.
A
.
A
is a
sparse
matrix (most entries are zero), how would your representation and approach change for the above operations (especially eigenvalue computation)?
Assume typical interview constraints such as n up to a few thousand for dense operations (memory permitting), and much larger for sparse matrices.