hashheap

package
v0.0.0-...-84d53aa Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparable

type Comparable interface {
	Less(b interface{}) bool
}

Comparable is an interface that allows object to order through comparison.

type HashedHeap

type HashedHeap struct {
	// contains filtered or unexported fields
}

HashedHeap is a data structure for hash and priority queue.

func New

func New() *HashedHeap

New returns HashedHeap.

func (*HashedHeap) Del

func (h *HashedHeap) Del(key string) (deleteValue Comparable)

Del deletes value by key.

func (*HashedHeap) Get

func (h *HashedHeap) Get(key string) (value Comparable)

Get get value by key.

func (*HashedHeap) Len

func (h *HashedHeap) Len() int

Len returns length.

func (*HashedHeap) Peek

func (h *HashedHeap) Peek() (value Comparable)

Peek peek value by priority.

func (*HashedHeap) Pop

func (h *HashedHeap) Pop() (value Comparable)

Pop pop value by priority.

func (*HashedHeap) Set

func (h *HashedHeap) Set(key string, value Comparable) (evictValue Comparable)

Set set value by key.

Jump to

Keyboard shortcuts

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