Faster permutation algorithms
authorRobin Houston <robin@cpan.org>
Wed, 22 Aug 2001 23:06:16 +0000 (00:06 +0100)
committerArtur Bergman <sky@nanisky.com>
Thu, 23 Aug 2001 11:36:29 +0000 (11:36 +0000)
Message-ID: <20010822230616.A254@robin.kitsite.com>

p4raw-id: //depot/perl@11733

pod/perlfaq4.pod

index 08f23f0..ff96afd 100644 (file)
@@ -1291,6 +1291,12 @@ in the permute() function should work on any list:
        }
     }
 
+Unfortunately, this algorithm is very inefficient. The Algorithm::Permute
+module from CPAN runs at least an order of magnitude faster. If you don't
+have a C compiler (or a binary distribution of Algorithm::Permute), then
+you can use List::Permutor which is written in pure Perl, and is still
+several times faster than the toy algorithm above.
+
 =head2 How do I sort an array by (anything)?
 
 Supply a comparison function to sort() (described in L<perlfunc/sort>):