I have been trying to write a recursive function to print the permutations of a n-digit number.
This is the logic that i am trying to use.
1.call the permutation function,
2.keep the first digit in the first place and send the remaining 2 digits back to the permutation function recursively.
3.keep one of the two digits received and send the remaining digit to the permute function.
4. keep doing this till only one digit remains. this is the smallest solution so return it.
this is more a general idea of what i am trying to do. pls help.