Help for this page

Select Code to Download


  1. or download this
    
    
      # Reverse sort the set and partitions and insert sums
    
  2. or download this
      @$rs = reverse sort numerically @$rs ;
      @a   = ($sa, reverse sort numerically @a) ;
      @b   = ($sb, reverse sort numerically @b) ;
    
  3. or download this
      # Done -- return partitins in required order
    
  4. or download this
      if ($a[0] >= $b[0]) { return (\@a, \@b) ; }
                     else { return (\@b, \@a) ; } ;
    } ;
    
  5. or download this
        # Sort the callers array in-place
        @$set = sort{ $b<=>$a } @$set;
    ...
            : ([ $sumB, sort{ $b<=>$a } @partB ], [ $sumA, sort{ $b<=>$a }
    + @partA ])
        ;
    }