On Mon, Jan 01, 2001 at 04:31:42PM -0600, Jarkko Hietaniemi wrote:
(1) Quicksort has a weak point where it goes deep into the Quadratic Land:
(nearly) already ordered data. No, that is not so far-fetched a case.
Mergesort has no similar weakpoints: its performance is in fact
Jarkko Hietaniemi wrote:
"sort heuristic"? "DWIM both numeric and string data"? There is
no "heuristic". There is no "DWIM". Perl's sort() does by default
string sort based on the byte values of the strings of its argument
list. That's it. Period. Full stop.
Oh.
$ perl -le
"JSD" == Jonathan Scott Duff [EMAIL PROTECTED] writes:
JSD On Mon, Jan 01, 2001 at 04:31:42PM -0600, Jarkko Hietaniemi wrote:
(1) Quicksort has a weak point where it goes deep into the Quadratic Land:
(nearly) already ordered data. No, that is not so far-fetched a case.
Mergesort
On Fri, Dec 29, 2000 at 11:47:59PM -0600, Jarkko Hietaniemi wrote:
The sorting algorithm? Before 5.005 (I think...my memory is going)
vendors' quicksort, after that Tom Horsley's excellent ultratuned
quicksort (since vendors' quicksorts were (a) buggy (c) slow),
in 5.7 mergesort by John
On Mon, Jan 01, 2001 at 02:04:25PM -0600, Jonathan Scott Duff wrote:
On Fri, Dec 29, 2000 at 11:47:59PM -0600, Jarkko Hietaniemi wrote:
The sorting algorithm? Before 5.005 (I think...my memory is going)
vendors' quicksort, after that Tom Horsley's excellent ultratuned
quicksort (since
"David L. Nicol" [EMAIL PROTECTED] writes:
Piers Cawley [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] (Yitzchak Scott-Thoennes) writes:
$srt =~ tr/0-9a-z\xe9/a-jA-ZE/; # uc sort nums after letters
`10' is going to sort before `2' with that rule. Having done the whole
bitter
Piers Cawley wrote:
"David L. Nicol" [EMAIL PROTECTED] writes:
After reading Cawley's
method, I wondered if using it we could make radix-sorts the
default sort method.
Er... the point behind changing numbers to binary strings was
emphatically not so that they could be sorted by a
On Sat, Dec 30, 2000 at 05:31:29AM +, David L. Nicol wrote:
Piers Cawley wrote:
"David L. Nicol" [EMAIL PROTECTED] writes:
After reading Cawley's
method, I wondered if using it we could make radix-sorts the
default sort method.
Er... the point behind changing numbers to
Nathan Torkington wrote:
By "pluggable" you mean that sort() should be overridable?
use D::Oh s s\?s.s;
--
John Porter
What would Gabrielle do?
At 03:43 PM 12/28/00 -0500, John Porter wrote:
Dan Sugalski wrote:
use sort qw(radix_sort);
sort \radix_sort @data;
Isn't that the slot where the comparison function goes?
Maybe something more like this:
use sort::radix_sort;
sort @data; # magically uses radix_sort instead of
Jarkko Hietaniemi wrote:
If someone wants to play with such ideas there's Perl 5.7 which has a
new mergesort as the incore sorting algorithm, while Perl 5.6 and before
used quicksort.
I'm triggering on the word "incore" there...
I seem to recall someone suggested on perl6-language a while
On Wed, Dec 27, 2000 at 06:36:56PM -0600, David L. Nicol wrote:
Is there a perl6 sort committee yet? AFter reading Cawley's
method here, I wonder if using it we could make radix-sorts the
default sort method.
Radix sorts are great if the data cooperates, radix sorts can really
fly in such
At 06:36 PM 12/27/00 -0600, David L. Nicol wrote:
Is there a perl6 sort committee yet? AFter reading Cawley's
method here, I wonder if using it we could make radix-sorts the
default sort method.
I don't see any reason to not allow this--perhaps a lexically scoped
assignment to
Dan Sugalski wrote:
use sort qw(radix_sort);
sort \radix_sort @data;
Isn't that the slot where the comparison function goes?
Maybe something more like this:
use sort::radix_sort;
sort @data; # magically uses radix_sort instead of default.
--
John Porter
What would Gabrielle do?
On Thu, Dec 28, 2000 at 03:43:21PM -0500, John Porter wrote:
Dan Sugalski wrote:
use sort qw(radix_sort);
sort \radix_sort @data;
Isn't that the slot where the comparison function goes?
Maybe something more like this:
use sort::radix_sort;
sort @data; # magically uses
At 04:34 PM 12/28/00 -0500, John Porter wrote:
I seem to recall someone suggested on perl6-language a while back*
(or was it perl6-internals?) that perl ought also to support efficient
sorting of large volumes of data by using disk, the way unix sort does.
Pluggable algorithms would make this
Is there a perl6 sort committee yet? AFter reading Cawley's
method here, I wonder if using it we could make radix-sorts the
default sort method.
Original Message
Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 10490 invoked from network); 29
David L. Nicol wrote:
Is there a perl6 sort committee yet? AFter reading Cawley's
method here, I wonder if using it we could make radix-sorts the
default sort method.
Perl6 ought to support pluggable sort algorithms, just as Perl
now supports pluggable comparison functions.
--
John
John Porter writes:
Perl6 ought to support pluggable sort algorithms, just as Perl
now supports pluggable comparison functions.
By "pluggable" you mean that sort() should be overridable?
Nat
19 matches
Mail list logo