Optimizing Java using D

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 23 11:04:05 PDT 2014


> Sent: Monday, June 23, 2014 at 10:26 AM
> From: "Andrei Alexandrescu via Digitalmars-d" <digitalmars-d at puremagic.com>
> To: digitalmars-d at puremagic.com
> Subject: Re: Optimizing Java using D
>
> Corollary: the default sorting algorithm in std will always be unstable, 
> even if for certain data types and inputs it will produce stable 
> sorting. -- Andrei

Essentially, the sorting order of unstable sort is undefined, so it _can_
produce stable sorting, but it's not guaranteed to. It would be kind of silly
to try and make it so that unstable sort was _guaranteed_ to not produce
unstable sorting. We _technically_ could write an algorithm that was always
stable but named unstableSort without violating what unstable sort is. It
would just be silly.

- Jonathan M Davis


More information about the Digitalmars-d mailing list