Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

RE: Re: Randomize an array

by Adam (Vicar)
on Sep 08, 2000 at 05:01 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://31525]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found