Came across this class for permutating a set of values. When executed, it dumps the permutations to System.out. My question: is there a way to get each permuted value as a string or int instead/as well?
Much appreciated
Perm.java
Permutator Help
Started by Victor, Dec 25 2008 11:03 PM
5 replies to this topic
#1
Posted 25 December 2008 - 11:03 PM
|
|
|
#2
Posted 26 December 2008 - 06:52 AM
I haven't looked at the linked code, but putting the data into an array should work.
#3
Posted 30 December 2008 - 02:03 PM
#4
Posted 30 December 2008 - 06:14 PM
Having just looked at the code, are you aware of how many permutations of the string "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" there are? While you could (in theory) produce all the permutations, to store them in memory will cause a memory overflow on any computer in existence.
#5
Posted 30 December 2008 - 06:28 PM
This is just the code I based mine off of. The string I'm using is much shorter
#6
Posted 31 December 2008 - 07:04 AM
Just realize that, given a string of length n, the memory required to store it will be approximately n*(n!) bytes, more if using unicode strings.


Sign In
Create Account


Back to top









