Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

RE: Re: Randomize an array

by Adam (Vicar)
on Sep 08, 2000 at 05:01 UTC ( #31525=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub Qsort  # WRONG! See update below!
    {
    ...
        push( $_ gt $pivot ? @gt : @lt ) for @_;
        return( Qsort( @lt ), $pivot, Qsort( @gt ) );
    }
    
  2. or download this
    sub Qsort
    {
    ...
    
    sub Swap { ${$_[0]}->[$_[1],$_[2]] = ${$_[0]}->[$_[1],$_[2]] }
    # Warning, untested code... 
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2019-05-27 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (156 votes). Check out past polls.

    Notices?