Than swap space and greater element convert { 3 , 2 , 999 } to { 999 , 2 , 3 }
arr [ index - 1 ] , arr [ index + 1 ] = arr [ index + 1 ] , arr [ index - 1 ] NEW_LINE else : NEW_LINE if ( index - 1 < 0 ) : NEW_LINE INDENT return NEW_LINE DEDENT arr [ index ] , arr [ index - 1 ] = arr [ index - 1 ] , arr [ index ] NEW_LINE sortRec ( arr , index - 1 , k - 1 , n ) NEW_LINE