Efficient sort function allowing own test and swap function as parameter

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Oct 6 22:39:06 UTC 2020


On Tue, Oct 06, 2020 at 10:18:39PM +0000, 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 I can plugin my
> proper test of order, and proper swap. Currently I do it using an own
> written bubble sort that doesn't scale well.

Why don't you use std.algorithm.sort? That's what the standard library
is for.


T

-- 
Being able to learn is a great learning; being able to unlearn is a greater learning.


More information about the Digitalmars-d-learn mailing list