|
-
May 18th, 2011, 06:28 PM
#5
Re: Permutations with repeated elements
 Originally Posted by henryswanson
I've tried using that, but it's far too slow. I think that might be because it produces things in a strict order.
And maybe because you're not timing an optimized build of your program, and instead timing a "debug" or non-optimized version of the program.
Secondly, a simple question -- did the next_permutation() work? If it did, and the speed is acceptable, what is the issue? In your example, 5! == 120, IMO hardly anything to worry about.
If you're looking for combinations and not permutations, then see my contribution to the thread below:
http://www.codeguru.com/forum/showthread.php?t=241675
Regards,
Paul McKenzie
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|