digitalmars.D - array.sort - What algorithm is being used here?
- "Daniel Harper" <djharperuk gmail.com> Sep 16 2012
- "jerro" <a a.com> Sep 16 2012
- deadalnix <deadalnix gmail.com> Sep 16 2012
- "Daniel Harper" <djharperuk gmail.com> Sep 16 2012
- Jonathan M Davis <jmdavisProg gmx.com> Sep 16 2012
- "Peter Alexander" <peter.alexander.au gmail.com> Sep 16 2012
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?
Sep 16 2012
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.
Sep 16 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.
Sep 16 2012
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?
Sep 16 2012
On Monday, September 17, 2012 00:42:40 deadalnix wrote:I'd argue that .sort must be blasted out of existence.
I can't remember if it was agreed that it should be deprecated or not. Too many items like that are _supposed_ to be deprecated (with Walter's full agreement) but still persist, but I don't remember if Walter agreed to axe this one or not. I definitely think that it should go though. - Jonathan M Davis
Sep 16 2012
On Monday, 17 September 2012 at 00:09:36 UTC, Jonathan M Davis wrote:On Monday, September 17, 2012 00:42:40 deadalnix wrote:I'd argue that .sort must be blasted out of existence.
I can't remember if it was agreed that it should be deprecated or not. Too many items like that are _supposed_ to be deprecated (with Walter's full agreement) but still persist, but I don't remember if Walter agreed to axe this one or not. I definitely think that it should go though. - Jonathan M Davis
It's on the deprecated list (3rd from bottom): http://dlang.org/deprecate.html No schedule for deprecation though. Just says "future".
Sep 16 2012









deadalnix <deadalnix gmail.com> 