Question: 9. Write the routines for the following declarations void permute (const string&str) void permute (const string&str, int low, int high) : The First routine is
9. Write the routines for the following declarations void permute (const string&str) void permute (const string&str, int low, int high) : The First routine is the driver that calls the second and prints all the permutations of the string str. Hint: think about how you would solve the problem if you already had a working version of permute (str, low, high) You may not use the STL permute function to solve this problem! You must use recursion. If you have an unusually good solution, you may be asked to explain it to the class in detail so we can all learn. You may also change the parameter list as desired. The low and the high are used to indicated boundaries in the passed str. The instructor's solution needed only the string and one integer as parameters and that recursive routine only took about 6 lines of code. So you may feel free to change the parameter list, if desired
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
