Function to print the sorted array if elements are swapped .
static void getSortedArray ( int arr1 [ ] , int arr2 [ ] , int n ) { if ( swapElement ( arr1 , arr2 , n ) ) { for ( int i = 0 ; i < n ; i ++ ) { System . out . print ( arr1 [ i ] + " ▁ " ) ; } } else { System . out . println ( " Not ▁ Possible " ) ; } }