How to get next pemutation in lesser order rather than greator order

Can i have the code implementation

use prev_permutation for that