The Vindication of Bubble Sort

from blog Two-Wrongs, | ↗ original
The case was that a sequence was supposed to be sorted, but it wasn’t critical if it wasn’t. I.e. the more well-sorted the sequence was, the better, but everything would work okay-ish even with a random order. The sequence couldn’t be sorted up-front for two reasons: This was a soft-realtime application, so at no point could the sequence be sorted without blowing several deadlines. The sequence itself changed and was replaced every now and then, so in...