Subject: | I've only used heap sort and quick... |
Summary: | Package rating comment |
Messages: | 1 |
Author: | Scott Matthews |
Date: | 2008-10-22 11:56:17 |
|
|
|
Scott Matthews rated this package as follows:
Utility: | Good |
Consistency: | Good |
Documentation: | Sufficient |
Examples: | Good |
|
Scott Matthews - 2008-10-22 11:56:17
I've only used heap sort and quick sort for this so far. I was really happy to find someone else had implemented this because I needed a more efficient sort approach than usort.
My main issue was that there is a bug in quick sort if the length of the array is less than 3. For large arrays, there is the potential for that block of implementation (if(!isset($arr[2]))) to return values that are not sorted. I added a check in it to swap the values if they are not in the order desired.
Also, it would be good to have an option for these to be ascending or descending. I've re-implemented them as quicksort_descending for my purpose since I didn't want the extra conditional check to slow the processing down.
|