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...