The recursive decomposition presented in section 8.3 to solve the problem of generating permutations is not the only effective strategy. Another way of implementing the recursive case looks like this:
a) Remove the first character from the string and store it in the variable ch.
b) Generate the set containing all permutations of the remaining characters.
c) Form a new set by inserting ch in every possible position in each of those permutations. Rewrite the Permutations program so that it uses this new strategy.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here