Story

On air. The free wire runs 15 minutes behind live. See pricing

World, crypto, finance and tech news, scored for impact.

TechHacker NewsFiled 2 days ago

I Can't Believe It Can Sort!

Open the sourceReported by Hacker News, yugen-tsuki.github.io, 13 November 2026

Not investment advice. Muhabbit scores how much a story may matter, not which way to trade.

A newly popularized sorting algorithm, dubbed “I Can’t Believe It Can Sort,” uses two nested loops over all n elements and swaps whenever A[i] < A[j], yet still produces a correctly sorted array despite appearing counterintuitive. The method runs in O(n^2) time, making it substantially less efficient than quicksort or mergesort, which offer better average and worst-case performance. Its significance lies less in practical speed than in pedagogy: the algorithm challenges assumptions about what correct sorting code must look like and offers a compact case study in loop invariants and proof of correctness. Next, watch for classroom and interview use of the example, along with follow-up analyses comparing its swap counts and runtime against standard quadratic sorts such as insertion and selection sort.

Muhabbit's AI wrote this summary in its own words from Hacker News's report. It can get details wrong, so check the source.

Named in this story

I Can't Believe It Can Sort, Stanley P. Y. Fung