in reply to Re: permute n elements2
in thread permute n elements2

thanks for info. just need to know where to insert into the program so it will eliminate repeating permutations. I did a permutation that should of yielded 420 rearrangements, I ended up with 11 of the same for each original ( close to 5000 permutations ). I await the expertise of the all knowing one!

Replies are listed 'Best First'.
RE: RE: Re: permute n elements2
by chromatic (Archbishop) on Oct 25, 2000 at 02:57 UTC
    That depends on what program you're using.

    If you're using the snippet from the perlfaq, you'll have to modify it somewhat. The easiest solution would be to return the values instead of printing it. In that case, my solution works as stands.

    The FAQ answer is recursive, so modifying it to use a hash internally is non-trivial, and it would take more time to change and to debug. Hope this helps.

    A reply falls below the community's threshold of quality. You may see it by logging in.