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

He was only searching 16 strings. The overhead of a binary search on such a small N would likely overwhelm the algorithmic improvements of moving from an O(N) to O(log N) implementation.


The table is optimized for 16 strings, but there's a reference to "linear scanning an array of string tables" so I thought the total input was larger. Anyways the size of the set is important information.




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

Search: