What would be the easiest way to generate an array of all of the possible permutations of a string which will be a various length. I'm using java if it matters
And no, this isn't homework.
Name:
Anonymous2013-02-02 2:39
Hard code all possible values as constants and use a table to look them up.
There's a relatively simple solution that involves recursion and mutable array swappings. To get it list of them you'll have to copy them out to a list of solutions. The very wonderful way implementation uses a coroutine, allowing iteration through all permutations using linear stack space.
Name:
Anonymous2013-02-02 3:59
Haskell has the permutations function in its standard library.