array.sort - What algorithm is being used here?

deadalnix deadalnix at gmail.com
Sun Sep 16 15:42:40 PDT 2012


Le 17/09/2012 00:29, Daniel Harper a écrit :
> On Sunday, 16 September 2012 at 20:52:03 UTC, jerro wrote:
>> On Sunday, 16 September 2012 at 20:29:50 UTC, Daniel Harper wrote:
>>> It's not clear in the documentation (http://dlang.org/arrays.html)
>>> what sorting algorithm is being used behind the array.sort
>>> implementation.
>>>
>>> Can anyone shed any light? I.e. is it quicksort?
>>
>> It is. The source is here
>> https://github.com/D-Programming-Language/druntime/blob/master/src/rt/qsort.d
>> . You should probably be using std.algorithm.sort, though.
>
> Thanks for the prompt reply.
>
> Perhaps the documentation can be updated to reflect this?

I'd argue that .sort must be blasted out of existence.


More information about the Digitalmars-d mailing list