Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Steinhaus - Johnson - Trotter Algorithm for Permutations (explain)

by barrachois (Pilgrim)
on Jan 04, 2005 at 18:55 UTC ( [id://419372]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >  # @p is the position of each element in @o,
    >  # that is, @o = (0..$#e)[@p]
    >  my @p= (0..$#e);
    >  # Note that it is also true that @p = (0..$#e)[@o].
    
  2. or download this
      # an arbitrary permutation
      @o = @permutation = (1,2,0);
    ...
      @p = @positions   = (2,0,1); 
      # And then 
      print " o[p] = (@o[@p]) = p[o] = (@p[@o]) \n";
    
  3. or download this
     o[p] = (0 1 2) = p[o] = (0 1 2)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found