Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

in place transpose in a matrix in java

  //Transpose a Matrix

  for (int row = 0; row < matrix.length; row++) {
    
   for (int col = row; row < matrix[row].length; col++) 
   {
    	// Swap 
     	int data = matrix[row][col];
    	matrix[row][col] = matrix[col][row];
   		matrix[col][row] = data;
   }
  
  }
Source by github.com #
 
PREVIOUS NEXT
Tagged: #place #transpose #matrix #java
ADD COMMENT
Topic
Name
5+7 =