Logo
The first computer mouse had only one button.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Stalin-sort Memes

Posts tagged with Stalin-sort

Sorting O

Algorithms Programming Math
2 months ago 1.7M views 0 shares
Sorting O
Historians just uncovered a revolutionary sorting algorithm from the Soviet archives: Stalin Sort . The time complexity? A beautiful O(n) – because you simply eliminate any elements that aren't in the correct position. No comparisons, no swaps, just... removal. Technically the remaining elements ARE sorted, right? The algorithm is brutally efficient: scan through the array once, and if an element doesn't fit where you want it, shoot it out of line (delete it from memory). Keep going until what's left is perfectly ordered. Sure, you might end up with an empty array, but an empty array is technically sorted! Computer scientists hate this one weird trick because it violates every principle of data preservation, but you can't argue with O(n) performance. Just don't ask about the space complexity of all those deleted elements.

Today's picks

CafePress 10 Types Of People Mug 11 oz (325 ml) Ceramic Coffee Mug

CafePress 10 Types Of People Mug 11 oz (325 ml) Ceramic Coffee Mug

Affiliate
$12.99
You little shit..

You little shit..

Debugging
71.4K views 3 years ago
Zig: 1 mascot isn't enough

Zig: 1 mascot isn't enough

Programming
110.0K views 4 years ago