Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"sorting with O(n^2) is no longer a bottleneck as we have fast processors" /s


That makes no sense. Just the brutal math of a polynomial is always going to be poor enough to notice than subpolynomial times.


Often but not always. Cool trick: any bounded limit is always O(1)!

Pick a small enough bound and an O(n^2) algorithm behaves better than an O(n log n). This is why insertion sort is used for sorting lengths less than ~64, for example.


Pick a small enough bound and certain O(n^2) algorithms will behave better than certain O(n log n) algorithms.

Big O notation doesn't take into account constant factors of overhead or plain old once-per-run overhead.


Sorry it was indeed a typo




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: