()
| 3 | import "fmt" |
| 4 | |
| 5 | func main() { |
| 6 | lru := Constructor(2) |
| 7 | lru.Put(2, 1) |
| 8 | lru.Put(1, 1) |
| 9 | lru.Put(2, 3) |
| 10 | lru.Put(4, 1) |
| 11 | fmt.Println(lru.head.next) |
| 12 | fmt.Println(lru.tail.prev) |
| 13 | // lru.Put(2, 2) |
| 14 | // // fmt.Println(lru.dLList.head) |
| 15 | // lru.Get(1) |
| 16 | // lru.Put(3, 3) |
| 17 | // fmt.Println(lru.dLList.tail.value) |
| 18 | // fmt.Println(lru.Get(2)) |
| 19 | |
| 20 | } |
| 21 | |
| 22 | type LRUCache struct { |
| 23 | cacheMap map[int]*DLNode |
nothing calls this directly
no test coverage detected