3 ms·
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 keep
by Gibbon1 3y ago
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.
- Thiez 3y agoExponential 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.