o
odin.langpkg.dev
packages / library / LRUCache

LRUCache

ea75ddblibrary

implementation of an LRU cache in Odin for fun.

No license · updated 3 weeks ago

Made an LRU Cache because i failed Speechify's coding interview so badly when they asked me about implementing this in Kotlin. In Kotlin, I didnt like the solution at all, since you just need to know that there is a special LinkedHashMap type, which also has a special function that lets you substitue in your boolean expression that will be used for eviction. that felt too trvia-y, if someone wasnt using that type and that special function, they just wouldn't know about. So I wanted to implement one from scractch and writing things in scrach just feels very freeing in Odin. "What I cannot create, I cannot understand" - Richard Feinmann


this Project morphed into a yaml parser lol, so if you go back far enough you will find the lru cache implementation at some point