Re: QuickSort on ranges

2020-10-18 Thread jerome via Digitalmars-d-learn
I posted some sum-up on my github. https://preview.tinyurl.com/y6sprdbq

Re: QuickSort on ranges

2020-10-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/4/20 6:50 AM, jerome wrote: Thanks you very much Ali, I will try to wrap my head around your inputs, and get a better understanding of ranges in the process. I feel there is a lot of power in D ranges, and like the hammer of Thor, I am not worthy yet :) Just to elaborate a bit

Re: QuickSort on ranges

2020-10-04 Thread jerome via Digitalmars-d-learn
Thanks you very much Ali, I will try to wrap my head around your inputs, and get a better understanding of ranges in the process. I feel there is a lot of power in D ranges, and like the hammer of Thor, I am not worthy yet :)

Re: QuickSort on ranges

2020-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 9/12/20 11:25 AM, jerome wrote: > > import std.stdio : writeln; > import std.algorithm.sorting; > > pure void quickSort(T) (T[] r) > { >if (r.length > 1) >{ > size_t p = pivotPartition(r, r.length-1); //r[$-1] is swapped to r[p] > >

QuickSort on ranges

2020-09-12 Thread jerome via Digitalmars-d-learn
Hi fellow coders, I spent a couple of hours to implement a working, basic, quicksort. Practicing D. It finally boils down to that (intent to use the std, not to rewrite swap, etc): import std.stdio : writeln; import std.algorithm.sorting; pure void