container

package
v0.0.0-...-7ac3615 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: BSD-3-Clause-Clear Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AVLIterator

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

func (*AVLIterator) HasNext

func (ite *AVLIterator) HasNext() bool

func (*AVLIterator) Next

func (ite *AVLIterator) Next() (any, any)

type AVLMap

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

func NewAVLMap

func NewAVLMap(comp Compare) *AVLMap

func (*AVLMap) Dump

func (avl *AVLMap) Dump()

func (*AVLMap) Find

func (avl *AVLMap) Find(key any) (any, bool)

func (*AVLMap) FindMax

func (avl *AVLMap) FindMax() (any, any, bool)

func (*AVLMap) FindMin

func (avl *AVLMap) FindMin() (any, any, bool)

func (*AVLMap) Insert

func (avl *AVLMap) Insert(key any, value any)

func (*AVLMap) Iterator

func (avl *AVLMap) Iterator() *AVLIterator

func (*AVLMap) Remove

func (avl *AVLMap) Remove(key any) (any, bool)

type BinarySearchST

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

func (*BinarySearchST) Delete

func (bsst *BinarySearchST) Delete(key interface{}) bool

func (*BinarySearchST) Get

func (bsst *BinarySearchST) Get(key interface{}) interface{}

func (*BinarySearchST) Init

func (bsst *BinarySearchST) Init()

func (*BinarySearchST) Put

func (bsst *BinarySearchST) Put(key interface{}, value interface{})

func (*BinarySearchST) Size

func (bsst *BinarySearchST) Size() int

type BitArray

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

func (*BitArray) Get

func (ba *BitArray) Get(idx int) (bool, bool)

*

第一个bool: 值
第二个bool: 是否有对应的值

func (*BitArray) Init

func (ba *BitArray) Init(cap int)

func (*BitArray) Set

func (ba *BitArray) Set(idx int, value bool) bool

type Color

type Color bool

type Compare

type Compare interface {
	// value:
	// 	  -1:
	//     0:
	//     1:
	Less(i, j interface{}) int
}

type CompareCommon

type CompareCommon struct {
}

func (*CompareCommon) Less

func (cc *CompareCommon) Less(i, j interface{}) int

type Iterator

type Iterator interface {
	HasNext() bool

	// 返回当前节点的key,value
	Next() (any, any)
}

type RBIterator

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

func (*RBIterator) HasNext

func (ite *RBIterator) HasNext() bool

func (*RBIterator) Next

func (ite *RBIterator) Next() (any, any)

type RBMap

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

func NewRedBlackMap

func NewRedBlackMap(comp Compare) *RBMap

func (*RBMap) ContainKey

func (rb *RBMap) ContainKey(key interface{}) bool

func (*RBMap) Find

func (rb *RBMap) Find(key any) (any, bool)

func (*RBMap) FindMax

func (rb *RBMap) FindMax() (any, any, bool)

func (*RBMap) FindMin

func (rb *RBMap) FindMin() (any, any, bool)

func (*RBMap) Get

func (rb *RBMap) Get(key interface{}) interface{}

func (*RBMap) Init

func (rb *RBMap) Init(comp Compare)

func (*RBMap) Insert

func (rb *RBMap) Insert(key any, value any)

func (*RBMap) Iterator

func (rb *RBMap) Iterator() *RBIterator

func (*RBMap) Remove

func (rb *RBMap) Remove(key any) bool

func (*RBMap) Size

func (rb *RBMap) Size() int

type RadixMap

type RadixMap struct {
}

func (*RadixMap) Init

func (rm *RadixMap) Init()

type SequentialSearchTree

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

func (*SequentialSearchTree) Init

func (sst *SequentialSearchTree) Init(comp Compare)

type SkipList

type SkipList struct {
}

func (*SkipList) Print

func (sl *SkipList) Print()

Jump to

Keyboard shortcuts

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