News for hackers. Stuff that matters.
Re:Faster than radix sort: Kirkpatrick-Reisch sorting by 1wd on Tuesday June 09, 2020 @02:53AM (#23464360)
O(n+n * log(w/log(n)) )

Wouldn't this decrease again for large enough n, and even go negative after n=2^(w * 2)?

Re:Faster than radix sort: Kirkpatrick-Reisch sorting by dan-robertson on Tuesday June 09, 2020 @03:17AM (#23464473)
The algorithm is to switch to a counting sort when w <= log n, ie n >= 2^w, so more properly the complexity is written:

  O(n+max(0,log(w/log n)))
Re:Faster than radix sort: Kirkpatrick-Reisch sorting by karpierz on Tuesday June 09, 2020 @03:04AM (#23464421)
The recursion assumes that log(n) > w; if log(n) <= w, then you're in the base case and it's O(n).
Re:Faster than radix sort: Kirkpatrick-Reisch sorting by rocqua on Tuesday June 09, 2020 @03:03AM (#23464412)
Not sure whether it applies here, but _if_ n is the number of unique values, you are limited here by the fact that there are only 2^w unique integers. Hence n < 2^w
Re:Faster than radix sort: Kirkpatrick-Reisch sorting by ben-schaaf on Tuesday June 09, 2020 @03:07AM (#23464436)
Not sure what's going on here, but that does indeed seem to be the case: https://www.wolframalpha.com/input/?i=x%2Bx+*+log%282%2Flog%...