News for hackers. Stuff that matters.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re... by Gibbon1 on Monday August 21, 2023 @01:50PM (#37212948)
I just remember something from basic math. Exponential curve < linear for small values.

That said a lot of time I have small arrays of objects. Instead of keeping them sorted I just grind through them to find the next largest value. That tends to be hard to get wrong.

Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re... by Thiez on Monday August 21, 2023 @05:35PM (#37215668)
Exponential can be better than linear for small n depending on your constant factors, but it's never a given. E.g. `2n` < `10^n + 5` for all n.