linear_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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareOrdered

func CompareOrdered[T cmp.Ordered](x, y T) bool

Types

type Comparer

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

type Node

type Node[K, V any] struct {
	// contains filtered or unexported fields
}

type SymbolTable

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

func NewSymbolTable

func NewSymbolTable[K cmp.Ordered, V any](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]) 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]) Keys

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

func (*SymbolTable[K, V]) Remove

func (st *SymbolTable[K, V]) Remove(key 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