• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding Permutations  RSS feed

 
Rahul Kakkar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!