Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: Permutations and combinations

by AltBlue (Chaplain)
on Aug 21, 2000 at 13:19 UTC ( #28783=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    # DESCRIPTION: Generate permutations in lexicographic order
    ...
       my ($i,$j) = @_; my $t = $a[$i];
       ($a[$i],$a[$j]) = ($a[$j],$t);
    }
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    die "bleah... nothing to permutate\n" unless defined @ARGV; 
    use Algorithm::Permute qw(permute permute_ref);
    print join(" ", @$_), "\n" for permute(\@ARGV);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://28783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-09-24 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (246 votes), past polls