![]() |
All possible combinations of a string
All possible combinations of a string
1. Finds all possible cominations of a given string. The total number of combinations with recurrences is the factorial of the string length. 2. Have given the word 'post' as an example since if I included a cin >> word; then a user may unconscientiously enter a long word which will take toooo long to end. To change to another word change the string str. 3. A 9 letter word like 'aeroplane' can take around 40 seconds on a 1GHz machine. A 10 letter word will take 9 x 40 s - thats 6 mins! So watch out for the string length. 4. This may time according to the length of the string str Code: CPP
|
Re: All possible combinations of a string
First of all welcome to the go4expert forums and yes a nice code also.
Can you mention which compiler it will compile as its not meant for Visual Studio as it has clrscr method. Thanks Shabbir Bhimani |
Re: All possible combinations of a string
I wrote this using TC++ 3.1.
It compiled and worked in TC++ 3.1 and Borland C++ 3.11. Remove clrscr() and it compiles and executes in vc++6 - checked. |
Re: All possible combinations of a string
Thats nice.
|
Re: All possible combinations of a string
Hi,
Thats an extraordinary contribution frnd.Thanx. sanjit khasnois |
Re: All possible combinations of a string
Thank you... with a little modification, I was able to make it work for my C# app that I am working on. Great code... too bad google ranks it so low in its engine
|
Re: All possible combinations of a string
Quote:
|
Re: All possible combinations of a string
hello
this is realy a very good code ... can any one tell me that what is the basic process of function void add (int[] , int); i need its processing flow plz if anybody can help me i'll be thankful |
Re: All possible combinations of a string
I should've documented this when I wrote this in college 4 yrs back.
I'll try to remember and repost this code with documentation. |
Re: All possible combinations of a string
hello
one more question is that plz tell me the logic of "if ((i-1)%fact(j)==0)" this condition in this code.. and plz send that documentation as soon as possible |
| All times are GMT +5.5. The time now is 13:44. |