Map

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSTMap

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

func NewBSTMap

func NewBSTMap() *BSTMap

func (*BSTMap) Add

func (b *BSTMap) Add(key interface{}, val interface{})

向二分搜索树中添加新的元素(key, value)

func (*BSTMap) Contains

func (b *BSTMap) Contains(key interface{}) bool

func (*BSTMap) Get

func (b *BSTMap) Get(key interface{}) interface{}

func (*BSTMap) IsEmpty

func (b *BSTMap) IsEmpty() bool

func (*BSTMap) Remove

func (b *BSTMap) Remove(key interface{}) interface{}

从二分搜索树中删除键为key的节点

func (*BSTMap) RemoveMin

func (b *BSTMap) RemoveMin() *Node

func (*BSTMap) Set

func (b *BSTMap) Set(key interface{}, val interface{})

func (*BSTMap) Size

func (b *BSTMap) Size() int

func (*BSTMap) String

func (b *BSTMap) String() string

type IMap

type IMap interface {
	Add(interface{}, interface{})
	Remove(interface{}) interface{}
	Contains(interface{}) bool
	Get(interface{}) interface{}
	Set(interface{}, interface{})
	Size() int
	IsEmpty() bool
}

type LinkedListMap

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

func NewLinkedListMap

func NewLinkedListMap() *LinkedListMap

func (*LinkedListMap) Add

func (l *LinkedListMap) Add(key interface{}, val interface{})

func (*LinkedListMap) Contains

func (l *LinkedListMap) Contains(key interface{}) bool

func (*LinkedListMap) Get

func (l *LinkedListMap) Get(key interface{}) interface{}

func (*LinkedListMap) IsEmpty

func (l *LinkedListMap) IsEmpty() bool

func (*LinkedListMap) Remove

func (l *LinkedListMap) Remove(key interface{}) interface{}

func (*LinkedListMap) Set

func (l *LinkedListMap) Set(key interface{}, val interface{})

func (*LinkedListMap) Size

func (l *LinkedListMap) Size() int

type LinkedListNode

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

type Node

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

func (*Node) Key

func (n *Node) Key() interface{}

func (*Node) Value

func (n *Node) Value() interface{}

Jump to

Keyboard shortcuts

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