MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

other/lfu_cache.py:199–205  ·  view source on GitHub ↗
(self, capacity: int)

Source from the content-addressed store, hash-verified

197 """
198
199 def __init__(self, capacity: int):
200 self.list: DoubleLinkedList[T, U] = DoubleLinkedList()
201 self.capacity = capacity
202 self.num_keys = 0
203 self.hits = 0
204 self.miss = 0
205 self.cache: dict[T, DoubleLinkedListNode[T, U]] = {}
206
207 def __repr__(self) -> str:
208 """

Callers

nothing calls this directly

Calls 1

DoubleLinkedListClass · 0.70

Tested by

no test coverage detected