TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Faster than radix sort: Kirkpatrick-Reisch sorting

193 pointsby milo_imalmost 5 years ago

7 comments

vanderZwanalmost 5 years ago
So since this sorting algorithm involves a trie, would there another optimization possibility by using a data structure inspired by the MergedTrie?<p>My first thought would be to split the list of numbers into a prefix and a suffix part and building two tries connected at the leaves[1][2], replacing the trie used in the article. Then we sort both tries using the Kirkpatrick-Reisch method (but in reverse order for the suffix trie so that the final result is sorted correctly), and finally we would have to reconnect the two while walking the tries.<p>[0] <a href="https:&#x2F;&#x2F;journals.plos.org&#x2F;plosone&#x2F;article?id=10.1371&#x2F;journal.pone.0215288" rel="nofollow">https:&#x2F;&#x2F;journals.plos.org&#x2F;plosone&#x2F;article?id=10.1371&#x2F;journal...</a><p>[1] more or less, the MT in the linked paper works a bit differently but also has a different use-case in mind.<p>[2] Also I have no idea if it make sense to have two depth 2 tries, or if there is <i>another</i> algorithm out there with two depth 1 tries that _kind_ of looks like this algorithm
评论 #23473283 未加载
olliejalmost 5 years ago
I suspect memory indirection would clobber the theoretical perf, but I&#x27;d be happy to be proved wrong.<p>My inclination is that this would be slower than &quot;standard&quot; high perf radix sorting, but I&#x27;m not sure if the high level overview of this algorithm represents an equivalent level of implementation.
oxxoxoxoooalmost 5 years ago
If you are into integer sorting, this might be of interest as well:<p><a href="https:&#x2F;&#x2F;yourbasic.org&#x2F;algorithms&#x2F;fastest-sorting-algorithm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yourbasic.org&#x2F;algorithms&#x2F;fastest-sorting-algorithm&#x2F;</a><p><a href="https:&#x2F;&#x2F;sorting.cr.yp.to&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sorting.cr.yp.to&#x2F;</a>
nathellalmost 5 years ago
Written by Tomek Czajka, a 3x TopCoder winner and algorithmic mastermind. Worth following!
评论 #23465578 未加载
评论 #23464468 未加载
1wdalmost 5 years ago
O(n+n * log(w&#x2F;log(n)) )<p>Wouldn&#x27;t this decrease again for large enough n, and even go negative after n=2^(w * 2)?
评论 #23464473 未加载
评论 #23464421 未加载
评论 #23464412 未加载
评论 #23464436 未加载
cwzwarichalmost 5 years ago
&gt; Faster<p>Benchmarks?
评论 #23464260 未加载
评论 #23463504 未加载
评论 #23463691 未加载
xiaodaialmost 5 years ago
I might be missing something but radix sort I can sort a 64 bit vector 11 bits at a time.