October 2025
Intermediate to advanced
485 pages
13h 2m
English
We’ve encountered many algorithms that perform differently based on best, average, and worst-case scenarios. Sometimes, the worst-case scenarios are pretty bad. But other times, worst-case scenarios can be really bad. The worst-case scenario for an LRU cache is, in fact, a nightmare.
This worst-case scenario can occur when performing a nested loop in which the inner loop iterates over a list of items where the number of items is ever so slightly greater than the number of items that the cache can store. Let me explain what I mean.
Continuing with our product price-searching app example, say that on the app’s homepage, we want to display some great deals from the web. Also, say that we want ...
Read now
Unlock full access