Here you can find the source of transpose(boolean[][] matrix)
Parameter | Description |
---|---|
matrix | a parameter |
public static boolean[][] transpose(boolean[][] matrix)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . jav a2s . c o m * return the transpose of a boolean matrix * @param matrix * @return */ public static boolean[][] transpose(boolean[][] matrix) { if (matrix == null) { return null; } int m = matrix.length; int n = matrix[0].length; boolean[][] t = new boolean[n][m]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { t[j][i] = matrix[i][j]; } } return t; } }