Comment

Comment by kazinator

There is obviously a LRU-like element in the algorithm because

1. Evacuation generally shifts items to the right.

2. The Hand moves to the left.

3. Items skipped by the Hand (appearing to its right) are spared from eviction until the Hand wraps around.

You can see it in the animation. D is flipped to visited just in the nick of time, and the Hand moves over it. Then it is spared from then on until the Hand wraps around (the animation doesn't go that far). Items that are used frequently will tend to be in the Visited state when the Hand passes over them, and stay cached.

parent kazinator 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton