Hacker News new | past | comments | ask | show | jobs | submit login

Sorting your data before searching it will only pay off if you need to search multiple things. If instead you need to search for one specific thing then going through things linearly is O(n) while sorting and searching the sorted result will be O(n log(n)).



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

Search: