[Slightly OT] Which algorithm for permutations

H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

Hi all,

In the thread ?Strategy or Iterator? (which should have been Command or
Iterator), I came up with a class which computes all possible
permutations of an array, one after another. Now I found 4 possible
algorithms to do this, on
http://www.cut-the-knot.org/do_you_know/AllPerm.shtml and
http://www.cut-the-knot.org/Curriculum/Combinatorics/JohnsonTrotter.shtml.
I was just wondering: is there any advantage of one above the other?
Probably not, as they all have to do n! calculations anyway...

Thanks, H.
(Please point me to the right place if I should ask this somewhere else.)
--
Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFECE5Me+7xMGD3itQRAmpaAJ4oO1a0kDWOKn5hKHdYOYj++fcpQQCfdk9O
eND9SVRkC0uaGNeBDVOJ3Ao=
=RgWM
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top