in reply to Re: Re: noncase-sensitive sorting
in thread noncase-sensitive sorting
Another factor that has some bearing on the comparative efficiency of the Schwartzian Transform versus a flat sort with additional complexity inside the sort code block is the issue of best case and worst case scenarios for the original unsorted list. In other words, a worst-case order of the original list may benefit more from the transform, while a best-case order for the original list may suffer from the transform.
The reason is that the two map's have a "fixed cost", whereas the code that appears within the code block of a sort function has a variable cost dependant on the original list's sort order.
The moral: If it really matters, benchmark it. ;)
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: noncase-sensitive sorting
by Roger (Parson) on Dec 02, 2003 at 07:25 UTC | |
by Abigail-II (Bishop) on Dec 02, 2003 at 10:48 UTC | |
by Roger (Parson) on Dec 02, 2003 at 11:34 UTC | |
by Abigail-II (Bishop) on Dec 02, 2003 at 12:46 UTC |