Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DLinkedNode ¶
type DLinkedNode struct { Key int Value int Prev *DLinkedNode Next *DLinkedNode }
双向链表
type LRUCache ¶
type LRUCache struct { Capacity int Length int Head *DLinkedNode Tail *DLinkedNode Nodes map[int]*DLinkedNode }
用一个辅助的头结点和尾结点
func Constructor ¶
func (*LRUCache) AddToHead ¶
func (this *LRUCache) AddToHead(node *DLinkedNode)
Click to show internal directories.
Click to hide internal directories.