Listing all permutations of a string/integer

A common task in programming interviews (not from my experience of interviews though) is to take a string or an integer and list every possible permutation.

Is there an example of how this is done and the logic behind solving such a problem?

I’ve seen a few code snippets but they weren’t well commented/explained and thus hard to follow.

28 Answers
28

Leave a Comment