Java Matrix Flip flipLR(int[][] x)

Here you can find the source of flipLR(int[][] x)

Description

flip LR

License

Open Source License

Declaration

static int[][] flipLR(int[][] x) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    static int[][] flipLR(int[][] x) {
        int[][] x2 = new int[x.length][x[0].length];

        for (int i = 0; i < x.length; i++) {
            for (int j = 0; j < x[0].length; j++) {
                x2[i][j] = x[i][x[0].length - j - 1];
            }/*from  ww w .j a va2  s .c  om*/
        }

        return x2;
    }
}

Related

  1. flipInPlace(int[][] theArray)
  2. flipLeftToRight(int[][] theArray)
  3. flipOverX(T[][] arr)
  4. flipOverY(T[][] arr)