sortedmap

package
Version: v0.0.0-...-c97c800 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchKey = errors.New("no such key exists")

Functions

func SearchInt64s

func SearchInt64s(a []int64, x int64) int

SearchInt64s implements sort.SearchInts for int64.

Types

type Map

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

Map is a sorted map[int64]int64.

func NewMap

func NewMap() Map

func (*Map) Delete

func (m *Map) Delete(k int64)

Delete deletes the value stored at k from the map.

func (*Map) Get

func (m *Map) Get(k int64) (v int64, ok bool)

Get gets the value at a specific key.

func (*Map) Insert

func (m *Map) Insert(k, v int64)

Insert inserts a key, value pair.

func (*Map) NearestGreater

func (m *Map) NearestGreater(want int64) (key, value int64, err error)

NearestGreater returns the nearest key, value pair that exists in the map with a key > want.

func (*Map) NearestLessEqual

func (m *Map) NearestLessEqual(want int64) (key, value int64, err error)

NearestLessEqual returns the nearest key, value pair that exists in the map with a key <= want.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL