4 ms·
I've implemented this for leetcode without realizing it's paper worthy: https://leetcode.com/problems/lfu-cache/ https://leetcode.com/problems/lfu-cache/ My im
by ghj 6y ago
I've implemented this for leetcode without realizing it's paper worthy: https://leetcode.com/problems/lfu-cache/ https://leetcode.com/problems/lfu-cache/
My implementation: https://pastebin.com/48mMTTdK https://pastebin.com/48mMTTdK
I am surprised to see that the paper was only published in 2010. I would expect something this simple to have been discovered earlier. I guess it's easy only after someone tells you constant time is possible.
- The_rationalist 6y agoI guess that it's more likely that someone implement an algorithm in an innovative way for its program than it is for one to publish a paper. But yeah maybe there's no blog anterior to the paper which would be surprising but possible.
- dominotw 6y agoI had this on phone screen :D.
- person_of_color 6y agoDid you get the job?
- bigyikes 6y agoI came here to say the same thing. I'm not even particularly good at this kind of thing.