(int capacity)
| 27 | private readonly DoublyLinkedListNode _tail; |
| 28 | |
| 29 | public LRUCache(int capacity) |
| 30 | { |
| 31 | _capacity = capacity; |
| 32 | |
| 33 | // A hash map that maps keys to nodes |
| 34 | _hashMap = new Dictionary<int, DoublyLinkedListNode>(); |
| 35 | |
| 36 | // Initialize the head and tail dummy nodes and connect them to |
| 37 | // each other to establish a basic two-node doubly linked list. |
| 38 | _head = new DoublyLinkedListNode(-1, -1); |
| 39 | _tail = new DoublyLinkedListNode(-1, -1); |
| 40 | _head.Next = _tail; |
| 41 | _tail.Prev = _head; |
| 42 | } |
| 43 | |
| 44 | public int Get(int key) |
| 45 | { |
nothing calls this directly
no outgoing calls
no test coverage detected