Skip to content

Adityasinghvats/LRU-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

LRU-CPP

This an implementation of true LRU using C++ structs and pointers.

TRUE-LRU-CACHE

  • The Problem with Standard LRU:
    • Traditional LRU algorithms often make assumptions about "recency" that aren't always accurate.1 Specifically, they can misinterpret the significance of newly added items.
    • A standard LRU will move a newly inserted item to the "most recently used" position, even if that item has never actually been accessed before. This can lead to the premature eviction of genuinely frequently used items.

  • True LRU's Focus on "True Recency":
    • "True LRU" aims to correct these inaccuracies by more precisely tracking the actual usage patterns of cached items.
    • It distinguishes between:
      • "Used and used" recency (how recently items that have been accessed were used).
      • "Used and unused" recency (how recently used items relate to those that have been placed in the cache, but never yet used).
      • "Unused and unused" recency (how to manage the order of items that have never been used).
    • By considering these distinctions, true LRU strives to achieve a more accurate representation of which items are truly the least recently used.

Project Architecture

Screenshot 2025-03-19 120125

Results

Screenshot 2025-03-19 111811

About

This an implementation of true LRU using C++ structs and pointers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages