Re: Efficient sort function allowing own test and swap function as parameter

2020-10-08 Thread Alaindevos via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 11:05:39 UTC, WebFreak001 wrote: On Tuesday, 6 October 2020 at 22:18:39 UTC, Alaindevos wrote: I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 22:18:39 UTC, Alaindevos wrote: I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I need an efficient sort function where I can plugin my proper

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 00:08:06 UTC, Ali Çehreli wrote: On 10/6/20 3:18 PM, Alaindevos wrote: [...] I had fun writing the following program. Note how makeIndex allows visiting elements in sorted order without actually sorting them. [...] Nice use of iota!

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-06 Thread Ali Çehreli via Digitalmars-d-learn
On 10/6/20 3:18 PM, Alaindevos wrote: I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I need an efficient sort function where I can plugin my proper test of order, and proper

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-06 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Oct 06, 2020 at 10:18:39PM +, Alaindevos via Digitalmars-d-learn wrote: > I have a large table consisting of two columns.One with words.Another > with frequencies. I want to sort them efficiently according to the > names or frequency. > For this I need an efficient sort function where

Efficient sort function allowing own test and swap function as parameter

2020-10-06 Thread Alaindevos via Digitalmars-d-learn
I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I need an efficient sort function where I can plugin my proper test of order, and proper swap. Currently I do it using an own