Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scramble --> help me to solve it

 
Manisekar Chinnasami
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,

here is the problem ...

i need to get all the combinations of a word ...

in detail ... if the input string is "man", then the output should be ...
(all itz combinations)
man
mna
amn
anm
nma
nam

three is little bit easy , but i need it for word with minimum five letters ....
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15490
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before starting to write code for this, think about the way you are going to solve this problem. How would you do this? You first need to have an idea of how it should work exactly, then you can start thinking about putting it down in code.

So, did you think about the problem yourself? Tell us how you think you could solve this, then we'll discuss if you're on the right way.

Also: Please check your private messages. You can see them by clicking "My Profile" at the top right of the page.
[ August 07, 2007: Message edited by: Jesper Young ]
 
Srikanth Basa
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manisekar Chinnasami:

in detail ... if the input string is "man", then the output should be ...
(all itz combinations)
man
mna
amn
anm
nma
nam
....


Did you mean permutations or combinations ? The example you gave are permutations.

Apart from that there are standard algorithms for getting the permutation. Just try google.
[ August 07, 2007: Message edited by: Srikanth Basavaraju ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Please don't post the same question to more than one forum; see our explanation here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic