100 POINTS - What is an algorithm to find all of the possibilities of the order of objects in a string? The length of the string is "i" units long, and there are 26 different types of characters in the string. I don't need the NUMBER of possibilities, I need the actual ones.

Respuesta :


Basically, for each item from left to right, all the permutations of the remaining items are generated (and each one is added with the current elements). This can be done recursively (or iteratively if you like pain) until the last item is reached at which point there is only one possible order.