• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scramble --> help me to solve it

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ....
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A "dutch baby" is not a baby. But this tiny ad is baby sized:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic