Why use LinkedHashMap in LruCache? Is HashMap OK?

Recently, a friend is preparing for an interview. We will discuss some interview questions in the group. Every time I will be hit hard, and I can't answer many questions. In normal development, Google and third parties use it very smoothly, which seems to solve the problem. In retrospect, there is no progress in technology. For example, I know ...

Added by BlackenedSky on Mon, 07 Feb 2022 12:01:57 +0200

One algorithm problem every day (java data structure and algorithm) - > least recently used cache LRU (process of analyzing appropriate data structure)

This is [031, the least cache used recently] on LeetCode, and the difficulty is [medium] subject Using the mastered data structure, design and implement an LRU (Least Recently Used) cache mechanism. Implement LRUCache class: LRUCache(int capacity) initializes the LRU cache with a positive integer as capacityint get(int key) if the keyword k ...

Added by grace5 on Tue, 04 Jan 2022 10:55:26 +0200