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

Sorting is O(kn) where k is the largest number. (See radix sorting)


It also requires O(k) memory which is certainly larger than L1, causing two stalls instead of one.


In this case, k is 26. Or ASCII value of 'z'. Either way, very cheap.




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

Search: