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 :: n queens problem leetcode 
Java :: calling method in java 
Java :: java isolate the numbers from string 
Java :: variable between two numbers java 
Java :: java get folder content 
Java :: java const 
Java :: how to declare an array in java 
Java :: opacity in android studio 
Java :: Cannot invoke toString() on the primitive type int 
Java :: spigot kill entity 
Java :: java bigdecimal check less zero 
Java :: java Modulo 10^9+7 (1000000007) 
Java :: convert fahrenheit to celsius 
Java :: object to int java 
Java :: how to make a copy of an array java 
Java :: android studio change image on button click 
Java :: java read directory 
Java :: check self permission android write_external_storage 
Java :: how to check if a string is numeric 
Java :: json to hashmap java stream 
Java :: awk print second 
Java :: java protected 
Java :: dark mode app android studio 
Java :: how to get data from radio group in android 
Java :: java remove last character 
Java :: how to change theme of app in android studio programmatically 
Java :: declare array of chars java 
Java :: java replace a character at end of string 
Java :: for each loop java string array 
Java :: from date to string 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =