For 1718:
- don't use #asSortedCollection for sorting.
- SortedCollection uses quicksort, not merge sort as stated in a comment.
That's why #asSortedCollection is slow when there are only a few different
values. Quicksort performance degrades to O(n^2) in this case, but that's
totally valid. Ho
I would be interested in improvements. This is just a straight translation
of the java code.
Yaroslavskiy's Dual-Pivot Quicksort seems to perform better for large
collections:
A straightforward
defaultSort: i to: j
self dualPivotQuicksort: i to: j split: 3
dualPivotQuicksort: left to: r