Ranges/algorithms for aggregation
bearophile
bearophileHUGS at lycos.com
Sat Mar 22 02:59:17 PDT 2014
Luís Marques:
> It would swap elements, like sort, so it doesn't need to put
> them anywhere, just permute them. The advantage is this:
>
> Input: [7, 3, 7, 1, 1, 1, 1]
> Output sort: [1, 1, 1, 1, 3, 7, 7]
> Output groupSort: [3, 7, 7, 1, 1, 1, 1]
I think to swap items it must know where to swap them to. And you
can't do that efficiently if the groups are unsorted.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list