Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RE: Permutations and combinations

by AltBlue (Chaplain)
on Aug 21, 2000 at 13:19 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://28783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-25 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found