Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A is obtained by changing A[i][j] to A[j][i].
For Square Matrix :
The below program finds transpose of A and stores the result in B, we can change N for different dimension.
Result matrix is 1 2 3 4 2 2 3 4 3 3 3 4 4 4 4 4
For Rectangular Matrix :
The below program finds transpose of A and stores the result in B.
Result matrix is 1 2 3 1 2 3 1 2 3 1 2 3
In-Place for Square Matrix:
Modified matrix is 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Please refer complete article on Program to find transpose of a matrix for more details!
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to find transpose of a matrix
- Inplace (Fixed space) M x N size matrix transpose | Updated
- Python Program for Column to Row Transpose using Pandas
- Python | Transpose elements of two dimensional list
- Python program to Convert a Matrix to Sparse Matrix
- Program to check diagonal matrix and scalar matrix
- Program to check if a matrix is Binary matrix or not
- Program to convert given Matrix to a Diagonal Matrix
- C++ program to Convert a Matrix to Sparse Matrix
- Python Program for Program to Print Matrix in Z form
- Find trace of matrix formed by adding Row-major and Column-major order of same matrix
- Python - Convert Matrix to Custom Tuple Matrix
- Python - Convert Integer Matrix to String Matrix
- Program to find Normal and Trace of a matrix
- Program to find all types of Matrix
- Program to find the maximum element in a Matrix
- Program to find the Sum of each Row and each Column of a Matrix
- Program to find the Product of diagonal elements of a matrix
- Maximize sum of N X N upper left sub-matrix from given 2N X 2N matrix
- Circular Matrix (Construct a matrix with numbers 1 to m*n in spiral way)