than swap space and greater element convert { 3 , 2 , 999 } to { 999 , 2 , 3 }
swap ( arr [ index - 1 ] , arr [ index + 1 ] ) ; } else swap ( arr [ index ] , arr [ index - 1 ] ) ; sortRec ( arr , index - 1 , k - 1 , n ) ; }