📦 Open Source Projects

Bubble Sort Lasted 47 Seconds on 1M Ints — Counting Sort Blitzed It in 0.04: My C Benchmarks

Theory says O(n^2) is O(n^2). Practice laughs. My C benchmark clocked Bubble Sort at 47 seconds for a million ints — while Counting Sort flew by in 40 milliseconds.

ASCII bar chart of sorting algorithm runtimes in C for 1M integers

⚡ Key Takeaways

  • O(n^2) sorts vary hugely: Bubble 47s vs Insertion 28s on 1M ints. 𝕏
  • Counting/Radix crush comparison sorts for integers, but niche. 𝕏
  • Benchmarks > theory: memcpy clones ensure fair fights. 𝕏
Published by

theAIcatchup

Community-driven. Code-first.

Worth sharing?

Get the best Open Source stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.