public void nextPermutation(int[] num) { boolean res = Permutation.next(num); if (!res) { sort(num); } }