I am reading/coding as fast as I can....
I feel stupid ... I'm suppost to make an career out of this ..programming, here you guy's pops this stuff out of your head in .... 2sek ....
pls tell me you are over 50, and have been doing with this in more than 30years, and spendt your last 10 years teaching this stuff on school...
Permutations
can i paste the results of running the program on 'mississippi' here ? it's only 439 KB (450,450 bytes). please ?
rotfl. nope, im only 19 atm and ive been playing around with Python for about a year. learn it! it will change your whole outlook @ programming :>
rotfl. nope, im only 19 atm and ive been playing around with Python for about a year. learn it! it will change your whole outlook @ programming :>
Quote:Original post by DarkSlayer
I am reading/coding as fast as I can....
I feel stupid ... I'm suppost to make an career out of this ..programming, here you guy's pops this stuff out of your head in .... 2sek ....
pls tell me you are over 50, and have been doing with this in more than 30years, and spendt your last 10 years teaching this stuff on school...
Not me, but my code was buggy when I first posted it...
Edit: It's fixed now...
[Edited by - Nathaniel Hammen on September 21, 2004 9:29:49 PM]
hehe ... mississippi is going to be reduced to 4600 or so permutations when i am done ... more printable.. hehe
weird, i am getting exactly 34650 permutations and my validator tells me that there are no repetitions
no, but i am going to apply more rules to which words to drop, so don't worry about that.... it is probably correct number
There, made the code work... it is in the middle of the night, listning to metallica ... of all, and in 4 hours ... back to school...
OK. Now I need some explanations .. just to clear it up..
Used h3r3tic code as base for now, I'll look into Nathaniel more closely tomorrow, since it looked like something interesting.
The word is first sorted (so that simmilar lettes are put togheter)
Then we create 2 arrays mainly, where we dump the first array into the last except the last letter .. which we keep??
no... I am silly, but the qlue is "which" letter we take out, and which we skip in this mess ...
I have to run this through the debugger tomorrow to see if I can understand it. Give me a day to present a more clean cpp code ... I had to rewrite to make it fit, but the annoying part is that I don't understand what is really going on ... and thats annoys me, because I like to have controll over things.
...but now ... sleep ... zzzzzzzz
thx for excelent help, couldn't do it without you guys
I'll be back....zzzzzzz
aslfjaslfkjslfjsalkj <- head falling on the keyboard...hehe
OK. Now I need some explanations .. just to clear it up..
Used h3r3tic code as base for now, I'll look into Nathaniel more closely tomorrow, since it looked like something interesting.
The word is first sorted (so that simmilar lettes are put togheter)
Then we create 2 arrays mainly, where we dump the first array into the last except the last letter .. which we keep??
no... I am silly, but the qlue is "which" letter we take out, and which we skip in this mess ...
I have to run this through the debugger tomorrow to see if I can understand it. Give me a day to present a more clean cpp code ... I had to rewrite to make it fit, but the annoying part is that I don't understand what is really going on ... and thats annoys me, because I like to have controll over things.
...but now ... sleep ... zzzzzzzz
thx for excelent help, couldn't do it without you guys
I'll be back....zzzzzzz
aslfjaslfkjslfjsalkj <- head falling on the keyboard...hehe
Well, my code works. I cleaned it up and tested it. Although it pauses every once in a while. It has to test whether it is a valid permutation. Essentially what my code does is add, in the base of however many different letters there are.
Edit: If you copied my code before I posted this, I would re-copy it, because your copy might be from before I fixed it.
Edit: My way of doing it is also EXTREMELY slow when you have a lot of different letters. For example, if you typed in the entire alphabet... it would take a long, long time.
[Edited by - Nathaniel Hammen on September 21, 2004 9:14:54 PM]
Edit: If you copied my code before I posted this, I would re-copy it, because your copy might be from before I fixed it.
Edit: My way of doing it is also EXTREMELY slow when you have a lot of different letters. For example, if you typed in the entire alphabet... it would take a long, long time.
[Edited by - Nathaniel Hammen on September 21, 2004 9:14:54 PM]
Quote:Original post by Nathaniel Hammen
Edit: My way of doing it is also EXTREMELY slow when you have a lot of different letters. For example, if you typed in the entire alphabet... it would take a long, long time.
Heh.
26! is somewhere about 4*1026 , so, i think , anything will take alot of time... say if it can print 108 permutations per second (it certanly can't, i would be surprised if it can print 1000 per second on windows console!)....
Even if it'll print 108 per second, it will take about 100 billions years(alot longer than existence of universe) to show all permutations, if i'm right.[grin]
(edit:had mistake with orders-of-magnitude, fixed.)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement