Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item interface { // Key is used for map index operations. Key() string // Less is used for heap sorting operations. Less(Item) bool // SetIndex is called by heap implementations to set the Item heap index. SetIndex(int) // Index returns the index of this Item. Index() int }
Item describes a type accepted by the mapped heap implementation.
type MappedHeap ¶
type MappedHeap struct {
// contains filtered or unexported fields
}
MappedHeap is a combination of map and heap structures which allows for efficient sorting, uniqueness guarantees, and constant time lookups. Implements heap.Interface.
func NewMappedHeap ¶
func NewMappedHeap() *MappedHeap
func (MappedHeap) Len ¶
func (mh MappedHeap) Len() int
func (MappedHeap) Less ¶
func (mh MappedHeap) Less(i, j int) bool
func (*MappedHeap) Pop ¶
func (mh *MappedHeap) Pop() interface{}
func (*MappedHeap) Push ¶
func (mh *MappedHeap) Push(x interface{})
func (*MappedHeap) Swap ¶
func (mh *MappedHeap) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.