logoalt Hacker News

momojoyesterday at 9:31 PM3 repliesview on HN

Do you have any examples of the second class?


Replies

zellynyesterday at 9:46 PM

The one that comes to mind is how big your hash maps have to get before all the clever algorithms beat linear scan, and it's surprisingly large on modern computers: linear memory access is _very_ predictable.

The Roc and Zig folks probably have actual numbers.

show 1 reply
mrkeenyesterday at 9:47 PM

Not sure if this counts, but I learned Huffman coding the intuitive tree-based way. From memory it was O(nlogn), but you can just O(n) it in-place in an array.

show 1 reply
jvanderbotyesterday at 10:20 PM

[dead]