Search
 
SCRIPT & CODE EXAMPLE
 

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;
   }
  
  }
Comment

transpose of a matrix java

for (int row = 0; row < matrix.length; row++) {
    
   for (int col = row; col < matrix[row].length; col++) 
   {
    	// Swap 
     	int data = matrix[row][col];
    	matrix[row][col] = matrix[col][row];
   		matrix[col][row] = data;
   }
  
  }
Comment

PREVIOUS NEXT
Code Example
Java :: how to increase the size of array in java 
Java :: java.lang.ArrayIndexOutOfBoundsException 
Java :: processing angle between two points 
Java :: polymorphism in oop 
Java :: java url 
Java :: how to find palindrome numbers in java 
Java :: check stack empty java 
Java :: java append a string to file 
Java :: java collection interface 
Java :: BufferredReader Class 
Java :: insertion sort in java 
Java :: for java 
Java :: jtable font size 
Java :: nosuchelementexception 
Java :: mono command to compile C# library code 
Java :: apache csv get headers 
Java :: send message bukkit 
Java :: java map merge example 
Java :: add custom font to android paint object 
Java :: export JAVA_HOME=` mac 
Java :: how to convert a string to char in java 
Java :: quarkus maven skip test 
Java :: spark write partitionby 
Java :: java string from byte array 
Java :: fibonacci series in java 
Java :: get date from calendar java 
Java :: adjust font scale in android studio 
Java :: how to empty list in java 
Java :: method java 
Java :: java protected keyword 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =