Function to print the required permutation
static void printPermutation ( int arr [ ] , int n ) { ArrayList < Integer > odd = new ArrayList < Integer > ( ) ; ArrayList < Integer > even = new ArrayList < Integer > ( ) ;