frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

DersCountsort: General-purpose sort with amortized O(N) complexity

2•dersoverflow•53m ago
Hi All!

If you are interested in sorting algorithms, you will learn something new: 1. It's commonly believed that, on average, comparison sorting can't perform better than O(Nlog(N)). But this is incorrect! The sorting is bounded by O(Clog(C)) where C is the number of unique elements (i.e., Cardinality). 2. In general, sorting has amortized O(N) complexity.

My DersCountsort is a sorting algorithm divided into three independent stages: 1. Creating a sorting sequence: O(C*log(C)). 2. Counting the number of unique elements: O(N). 3. Sorting: O(N).

For example, you can create a sorting sequence once and then use it many times. This achieves amortized O(N) complexity.

In essence, the sorting sequence is what distinguishes DersCountsort from other сounting sorts. Creating the sorting sequence is the hardest part of sorting. However, the sorting sequence once created can be used many times and is even relatively easy to modify when adding several new elements: O(C).

Here is my post on LinkedIn: https://www.linkedin.com/pulse/derscountsort-general-purpose-sort-amortized-sergey-derevyago-jzyrf/ The source code: https://ders.by/alg/derscountsort/code.zip The detailed description of the algorithm: https://ders.by/alg/derscountsort/derscountsort.html

P.S. To make life more challenging and interesting, I write my articles in Russian. Let me know if you prefer Japanese.

Engineers will do anything to avoid learning from history

https://horn.gg/blog/engineers-will-do-anything-to-avoid-learning-from-history/
1•madrox•1m ago•0 comments

Anthropic shares details about how Claude's new watermarks will work

https://techcrunch.com/2026/08/15/anthropic-shares-more-details-about-how-claudes-new-watermarks-...
1•sbulaev•2m ago•0 comments

Ask HN: I created a web browser using Claude, everybody hates it

3•roschdal•4m ago•0 comments

Free personalised attachment style quiz

https://tally.so/r/0QP0lj
1•ElysiumAbove•7m ago•0 comments

Dress Rehearsal for Life; ambition, self-myth and a cheque as heavy as the world [video]

https://www.youtube.com/watch?v=Wo2_zhS1uYY
1•devrob•8m ago•0 comments

Early Influences of Photography on Art – Part 1

https://www.artinsociety.com/pt-1-initial-impacts.html
1•breppp•14m ago•0 comments

Calorie tracker for my Garmin watch

https://ashu1461.com/posts/a-calorie-tracker-on-my-garmin-watch/
1•ashu1461•17m ago•0 comments

ActivityPub Won by Being Boring

https://o.ee/blog/activitypub-won-by-being-boring/
2•birdculture•18m ago•0 comments

Ask HN: Anyone got a deauthentication attack script?

1•emn4tor•18m ago•0 comments

Neo: A distraction-free word processor for authors, by a wannabe author

https://github.com/hughhowey/neo
1•jasonpeacock•19m ago•1 comments

Modeling and Verification of Keeta's Consensus [pdf]

https://xescu.re/keeta-consensus.pdf
1•xescure•19m ago•1 comments

Were Touch Bar's problems software rather than hardware?

https://unsung.aresluna.org/deeper-dive-were-touch-bars-problems-software-rather-than-hardware/
1•ingve•21m ago•0 comments

Bede Liu, a digital signal processing pioneer, has died

https://spectrum.ieee.org/digital-signal-processing
6•Jimmc414•23m ago•0 comments

Why AI agents need verified identity

https://chrisbergeron.com/2026/08/11/why_ai_agents_need_verified_identity/
2•speckx•24m ago•0 comments

The Wow signal was a strong narrowband radio signal detected on August 15, 1977

https://en.wikipedia.org/wiki/Wow!_signal
7•firefax•26m ago•0 comments

Show HN: Live Claude Usage HUD for a $38 Thermalright Trofeo Vision LCD

https://github.com/christensen143/claude-trofeo-hud
2•christensen143•27m ago•0 comments

Tracking down a Zsh history data loss bug

https://michael.stapelberg.ch/posts/2026-08-09-zsh-history-truncation-bug/
2•ingve•30m ago•0 comments

Book Review: The Escape Artist

https://www.astralcodexten.com/p/your-book-review-the-escape-artist
1•paulpauper•31m ago•0 comments

No-New-Physics Consciousness

https://www.overcomingbias.com/p/no-new-physics-consciousness
4•paulpauper•31m ago•0 comments

2026 Filing Season: Preliminary Observations on IRS Performance

https://www.gao.gov/products/gao-26-109074
1•Jimmc414•32m ago•0 comments

Tyler Cowen: A Conservative Case for Liberal Immigration

https://www.thefp.com/p/tyler-cowen-conservative-case-liberal-immigration-policy
3•paulpauper•34m ago•0 comments

I wrote OSS for fun. They called it Exceptional Talent

https://ryoppippi.com/blog/2026-08-15-uk-gtv-en/
1•ryoppippi•35m ago•1 comments

U.S. Urges Apple Not to Buy Chinese Memory Chips

https://www.wsj.com/tech/apple-china-memory-chip-plan-57773a83
7•bookofjoe•40m ago•3 comments

How to Confuse Some SSH Bots

https://nochan.net/b/Internet-Crap/20260108-Confuse-Some-SSH-Bots/
2•Bender•41m ago•0 comments

The AI Slop Backlash Is Having an Impact

https://www.wired.com/story/the-ai-slop-backlash-is-actually-having-an-impact/
4•herbertl•42m ago•0 comments

Show HN: TokenLab MCP, model discovery, pricing, and native AI endpoint tools

https://tokenlab.sh/zh/mcp
2•tokenlabai•43m ago•0 comments

Agentic Development Fallacies

https://thuva4.com/blog/agentic-development-fallacies/
4•thuva4•43m ago•0 comments

Augmenting Long-term Memory (2018)

https://augmentingcognition.com/ltm.html
3•re-framer•46m ago•0 comments

AI makes foundational knowledge more important

https://www.timeshighereducation.com/opinion/ai-makes-foundational-knowledge-more-important-ever
3•jruohonen•51m ago•0 comments

Hayward City Council will consider banning data centers at its Sept. 15 meeting

https://www.hayward-ca.gov/discover/news/aug26/hayward-council-consider-move-ban-data-centers-its...
4•MilnerRoute•51m ago•1 comments