On Tue, Jun 14, 2005 at 11:03:29PM -0600, Dan Wilson wrote:
> PS. This is for PHP, so if you have code examples, that would be
> even better.

For those who are interested in further exploring this problem in a
real programming language, I found this excellent little collection of
routines:

http://www.cs.berkeley.edu/~fateman/mma1.6/comb.lisp

This comment should give you a good idea of how you can build your
algorithm recursively:

    ;; otherwise take an element, e, out of the bag.
    ;; generate all permutations of the remaining elements.
    ;; and add e to the front of each of these.
    ;; do this for all possible e to generate all permutations.

Mmmmmm.... Lisp..... almost as scrumptious as Objective Caml...

Mike
.___________________________________________________________________.
                         Michael A. Halcrow                          
       Security Software Engineer, IBM Linux Technology Center       
GnuPG Fingerprint: 419C 5B1E 948A FA73 A54C  20F5 DB40 8531 6DCA 8769

I stole this Sig. 

Attachment: signature.asc
Description: Digital signature

.===================================.
| This has been a P.L.U.G. mailing. |
|      Don't Fear the Penguin.      |
|  IRC: #utah at irc.freenode.net   |
`==================================='

Reply via email to