int function ( ) { for ( int loc0 = n - 2 ; loc0 >= 0 ; loc0 -- ) { if ( index [ loc0 ] < index [ loc0 + 1 ] ) { return loc0 ; } } return - 1 ; }
get the index of the first element from the right that is less than its neighbor on the right . concode_field_sep T[] in concode_elem_sep int[] index concode_elem_sep int m concode_elem_sep int n concode_elem_sep T[] out concode_elem_sep boolean hasNext concode_field_sep boolean next concode_elem_sep void moveIndex concode_elem_sep Permutations<T> create concode_elem_sep Permutations<T> create concode_elem_sep void reverseAfter