If the first element of the array is positive , then right - rotate the array by one place first and then reverse the merged array .
if ( array [ start ] >= 0 ) { reverse ( array , ( start + 1 ) , end ) ; reverse ( array , start , end ) ; } }