Here you can find the source of transpose(boolean[][] inputMatrix)
static public boolean[][] transpose(boolean[][] inputMatrix)
//package com.java2s; //License from project: Open Source License public class Main { static public boolean[][] transpose(boolean[][] inputMatrix) { int nr = inputMatrix.length; int nc = inputMatrix[0].length; boolean[][] o = new boolean[nc][nr]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { o[j][i] = inputMatrix[i][j]; }// w w w . j a v a 2s. com } return o; } }