hi. i want to print all the possible combinations of a string entered. for example:- string input is "abc"... then output is "abc bac acb bca cba cab" and it must be true for every length of string.. i have tried many times and applied as much logics i can. but i m not getting. just tell me starting that how to proceed. i am not asking for code here, even i don't want. i will implement own my own. please help!!
gourav1 -12 Posting Whiz in Training
Recommended Answers
Jump to PostTry Googling for permutations so you can learn the basic algorithms.
Jump to PostHere's how I approach this problem:
1) sort the letters you have, lowest to highest. I always want the permutations to start with the lowest possible one, and work up to the highest one, and be in order. And have no repetitions.
2) You will work from right …
All 5 Replies
subith86 17 Junior Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
gourav1 -12 Posting Whiz in Training
Adak 419 Nearly a Posting Virtuoso
subith86 17 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.