We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c8a6c8 commit ab9c7afCopy full SHA for ab9c7af
other/least_recently_used.py
@@ -1,5 +1,4 @@
1
import sys
2
-from abc import abstractmethod
3
from collections import deque
4
5
@@ -10,7 +9,6 @@ class LRUCache:
10
9
key_reference_map = object() # References of the keys in cache
11
_MAX_CAPACITY: int = 10 # Maximum capacity of cache
12
13
- @abstractmethod
14
def __init__(self, n: int):
15
"""Creates an empty store and map for the keys.
16
The LRUCache is set the size n.
@@ -54,6 +52,7 @@ def display(self):
54
52
55
53
56
if __name__ == "__main__":
+
57
lru_cache = LRUCache(4)
58
lru_cache.refer(1)
59
lru_cache.refer(2)
0 commit comments