Documentation ¶ Index ¶ type Heap func NewHeap(k uint32) *Heap func (h *Heap) Add(val *Node) *Node func (h *Heap) Find(key string) (int, bool) func (h *Heap) Fix(idx int, count uint32) func (h *Heap) Min() uint32 func (h *Heap) Pop() *Node func (h *Heap) Sorted() Nodes type Node type Nodes func (n Nodes) Len() int func (n Nodes) Less(i, j int) bool func (n *Nodes) Pop() interface{} func (n *Nodes) Push(val interface{}) func (n Nodes) Swap(i, j int) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Heap ¶ type Heap struct { Nodes Nodes K uint32 } func NewHeap ¶ func NewHeap(k uint32) *Heap func (*Heap) Add ¶ func (h *Heap) Add(val *Node) *Node func (*Heap) Find ¶ func (h *Heap) Find(key string) (int, bool) func (*Heap) Fix ¶ func (h *Heap) Fix(idx int, count uint32) func (*Heap) Min ¶ func (h *Heap) Min() uint32 func (*Heap) Pop ¶ func (h *Heap) Pop() *Node func (*Heap) Sorted ¶ func (h *Heap) Sorted() Nodes type Node ¶ type Node struct { Key string Count uint32 } type Nodes ¶ type Nodes []*Node func (Nodes) Len ¶ func (n Nodes) Len() int func (Nodes) Less ¶ func (n Nodes) Less(i, j int) bool func (*Nodes) Pop ¶ func (n *Nodes) Pop() interface{} func (*Nodes) Push ¶ func (n *Nodes) Push(val interface{}) func (Nodes) Swap ¶ func (n Nodes) Swap(i, j int) Source Files ¶ View all Source files minheap.go Click to show internal directories. Click to hide internal directories.