LRU (implement in JAVA)

LRU(Least recently used) eliminates data based on the history of accesses, with the core idea being that “if data has been accessed recently, it has a higher chance of being accessed in the future”. We can use the LinkedHashMap built in Java. Also, we can implement this by ourselves.