binary_search

package
v0.0.0-...-6deb688 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 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 Comparer

type Comparer[T cmp.Ordered] func(x, y T) int

type SymbolTable

type SymbolTable[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func NewSymbolTable

func NewSymbolTable[K, V cmp.Ordered](comparer Comparer[K]) *SymbolTable[K, V]

func (*SymbolTable[K, V]) Add

func (st *SymbolTable[K, V]) Add(key K, value V)

func (*SymbolTable[K, V]) Ceiling

func (st *SymbolTable[K, V]) Ceiling(key K) (K, bool)

func (*SymbolTable[K, V]) Contains

func (st *SymbolTable[K, V]) Contains(key K) bool

func (*SymbolTable[K, V]) Count

func (st *SymbolTable[K, V]) Count() int

func (*SymbolTable[K, V]) Empty

func (st *SymbolTable[K, V]) Empty() bool

func (*SymbolTable[K, V]) Floor

func (st *SymbolTable[K, V]) Floor(key K) (K, bool)

func (*SymbolTable[K, V]) Keys

func (st *SymbolTable[K, V]) Keys() []K

func (*SymbolTable[K, V]) Max

func (st *SymbolTable[K, V]) Max() (K, bool)

func (*SymbolTable[K, V]) Min

func (st *SymbolTable[K, V]) Min() (K, bool)

func (*SymbolTable[K, V]) Range

func (st *SymbolTable[K, V]) Range(low, high K) ([]K, bool)

func (*SymbolTable[K, V]) Rank

func (st *SymbolTable[K, V]) Rank(key K) int

func (*SymbolTable[K, V]) Remove

func (st *SymbolTable[K, V]) Remove(key K) bool

func (*SymbolTable[K, V]) RemoveMax

func (st *SymbolTable[K, V]) RemoveMax() bool

func (*SymbolTable[K, V]) RemoveMin

func (st *SymbolTable[K, V]) RemoveMin() bool

func (*SymbolTable[K, V]) Select

func (st *SymbolTable[K, V]) Select(index int) (K, bool)

func (*SymbolTable[K, V]) TryGet

func (st *SymbolTable[K, V]) TryGet(key K) (V, bool)

Jump to

Keyboard shortcuts

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