saxbophone / tr-sort

Transpose-Sort —why sort numbers with comparisons when we can calculate their rough sort positions instead?
https://saxbophone.com/tr-sort
2 stars 0 forks source link

Mapping sorts without gaps #9

Open saxbophone opened 2 years ago

saxbophone commented 2 years ago

Maybe a quantisation process for the sort buckets might make the algorithm more efficient.

Alternatively, adding an additional pass to determine the size of each bucket by counting how many times a given index gets hit by the sort-mapping algorithm will allow us to map sorts more directly into their position without needing a temporary vector of vectors (this approach would still require sub-sorting, however, although we could keep track of whether numbers to be added into it are in-sequence and use this a shortcut to prevent unneeded sub-sorting).

Extension step: