aspose file tools
The moose likes Java in General and the fly likes Finding Permutations Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Finding Permutations" Watch "Finding Permutations" New topic
Author

Finding Permutations

Rahul Kakkar
Ranch Hand

Joined: Apr 17, 2005
Posts: 70
i'm unable to understand the code/algo behind generating string permutations.. could some explain the code to me? i've tried but am not able to get how its working
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Are you refering to a concrete algorithm?

To generate all permutations, you could use different algorithms.

One could be:
Generate a collection of combined objects, where every possible element is used as head, and the remaining elements are a Collection of remaining elements.

Repeat this method for the remaining elements, until they are all consumed.


http://home.arcor.de/hirnstrom/bewerbung
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Rahul Kakkar:
... could some explain the code to me? i've tried but am not able to get how its working

Can you describe what you've tried? And why you think it's not working?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Finding Permutations
 
Similar Threads
Iterating over an unknown number of vectors
Permutation help
String Unscrambler issues (Self-Resolved)
Permutations Generator
Permutations