Here you can find the source of swapColumns(int i, int j, boolean[][] matrix)
private static void swapColumns(int i, int j, boolean[][] matrix)
//package com.java2s; //License from project: Apache License public class Main { private static void swapColumns(int i, int j, boolean[][] matrix) { int m = matrix.length; if (m == 0) { // do nothing return; }//from w ww. j a va 2 s . c o m int n = matrix[0].length; if (i >= n || j >= n || i == j) { // do nothing return; } boolean temp; for (int k = 0; k < m; k++) { temp = matrix[k][i]; matrix[k][i] = matrix[k][j]; matrix[k][j] = temp; } } }