hashtable

package
v0.0.0-...-a6267c2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common struct {
	End  int
	Size int
}

type HashTable

type HashTable[I constraints.Ordered, K comparable] interface {
	Hash(id Key[I]) int

	Insert(id Key[I], data K) error
	Delete(id Key[I]) error
	Search(id Key[I]) (K, error)
	// contains filtered or unexported methods
}

func New

func New[I constraints.Ordered, K comparable](hashTable HashTable[I, K], parameters Common) HashTable[I, K]

type Key

type Key[K constraints.Ordered] interface {
	Value() K
	Index() int
}

type Linked

type Linked[I constraints.Ordered, K comparable] struct {
	// contains filtered or unexported fields
}

func (*Linked[I, K]) Delete

func (t *Linked[I, K]) Delete(id Key[I]) error

func (*Linked[I, K]) Hash

func (t *Linked[I, K]) Hash(id Key[I]) int

func (*Linked[I, K]) Insert

func (t *Linked[I, K]) Insert(id Key[I], data K) error

func (*Linked[I, K]) Search

func (t *Linked[I, K]) Search(id Key[I]) (K, error)

type Open

type Open[I constraints.Ordered, K comparable] struct {
	// contains filtered or unexported fields
}

func (*Open[I, K]) Delete

func (t *Open[I, K]) Delete(id Key[I]) error

func (*Open[I, K]) Hash

func (t *Open[I, K]) Hash(id Key[I]) int

func (*Open[I, K]) Insert

func (t *Open[I, K]) Insert(id Key[I], data K) error

func (*Open[I, K]) Search

func (t *Open[I, K]) Search(id Key[I]) (K, error)

Jump to

Keyboard shortcuts

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