here is another mathematical problem, where the trick is as much to discover the algorithm as it is to write the code; write a program to display all possible permutations of a given input string--if the string contains duplicate characters, you may have multiple repeated results. input should be of the form permute string and output should be a word per line.
here is a sample for the input cat
All you have to do is change it from an integer array to a string (and change the iterators in the function calls as well) and it works.
On a side note, the next time you have a question, please choose an appropriate title (example for this thread: Finding all permutations of a string), post a clear description of the problem (that includes the problem itself, and any tests cases), post what code you have and let us know where you are having troubles. This not only increases the likelihood of getting a response, but it also makes it much easier for us to answer you in a clear, concise manner.