Here you can find the source of flipOverY(T[][] arr)
Parameter | Description |
---|---|
arr | a parameter |
public static <T> void flipOverY(T[][] arr)
//package com.java2s; //License from project: Open Source License public class Main { /**// ww w .j a va2 s.co m * Flips the 2D Array as if around a Vertical Axis. Does not preserve original array. * @param arr */ public static <T> void flipOverY(T[][] arr) { for (int i = 0; i < arr.length; i++) { flipOverY(arr[i]); } } /** * Flips Array as if around a Vertical Axis. Does NOT preserve original array * @param arr */ public static <T> void flipOverY(T[] arr) { int z = arr.length - 1; for (int a = 0; a < z; a++) { T tmp = arr[a]; arr[a] = arr[z]; arr[z] = tmp; z--; } } }