logoalt Hacker News

SkiFire13today at 11:44 AM1 replyview on HN

> So O(n) could be faster than O(log n) depending on the size of the data structure and interactions with RAM pre-fetch, etc.

This has always been the case. The RAM effects only changed at which point the O(n) stops being faster than the O(log n) solution.


Replies

inigyoutoday at 2:03 PM

Apparently linear search now beats hashmap if you have less than TWO HUNDRED elements. Crazy!