kvheap

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StrIntHeap

type StrIntHeap []StrIntKV

StrIntHeap is a heap of StrIntKV. It implements heap.Interface.

func New

func New(m map[string]int64) *StrIntHeap

func (StrIntHeap) Len

func (h StrIntHeap) Len() int

func (StrIntHeap) Less

func (h StrIntHeap) Less(i, j int) bool

Less is greater-than here so that we can pop *larger* items.

func (*StrIntHeap) Pop

func (h *StrIntHeap) Pop() interface{}

func (*StrIntHeap) Push

func (h *StrIntHeap) Push(x interface{})

func (StrIntHeap) Swap

func (h StrIntHeap) Swap(i, j int)

type StrIntKV

type StrIntKV struct {
	Key   string
	Value int64
}

StrIntKV is a key-value pair. type of key is string and value is int64.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL