algo4: miscellaneous: Next permutation