sortedmap

package
v6.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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