Swap ith index value with ( n - i - 1 ) th index value
swap ( arr , i , n + ( x * i ) + x ) ; } static int [ ] swap ( int [ ] arr , int i , int j ) { int temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; return arr ; }