5 ms·
Are you even manually implementing sorts frequently? Even languages that are notorious for having tiny libraries, like C and JS, have built-in sorts.
by joaonmatos 4y ago
Are you even manually implementing sorts frequently?
Even languages that are notorious for having tiny libraries, like C and JS, have built-in sorts.
- mattgreenrocks 4y agoIt’s less about accidentally writing n^2 sorts and more about not accidentally creating n^2 algorithms.
- whstl 4y agoNot sorting, but very simple algorithms that can't afford having O(n^2) performance? That's common even in CRUD apps.
- dagw 4y agoPerhaps not sort so much, but certainly with search I've seen people roll their own inefficient search functions many times.
- joaonmatos 4y agoIt is the exact same situation, though. Most people can just chain a sort and a binary search to do it, and both are included in most languages. Or just put it into a tree map, if your language has it.