Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 chanting in the Monastery: (4)
As of 2016-04-30 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (441 votes). Check out past polls.