bstmap

package
v0.0.0-...-73cdf94 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BST

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

func NewBST

func NewBST() *BST

func (*BST) Add

func (b *BST) Add(k int, v interface{})

向二分搜索树中插入元素

func (*BST) Contains

func (b *BST) Contains(k int) bool

func (*BST) Get

func (b *BST) Get(k int) interface{}

func (*BST) IsEmpty

func (b *BST) IsEmpty() bool

func (*BST) Len

func (b *BST) Len() int

func (*BST) Minimum

func (b *BST) Minimum() *TreeNode

获取二分搜索树中的最小值

func (*BST) Remove

func (b *BST) Remove(k int) interface{}

func (*BST) RemoveMin

func (b *BST) RemoveMin() *TreeNode

删除二分搜索树中的最小值

func (*BST) Set

func (b *BST) Set(k int, val interface{})

type BSTMap

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

基于二分搜索树实现的Map

func (*BSTMap) Add

func (m *BSTMap) Add(k int, v interface{})

func (*BSTMap) Contains

func (m *BSTMap) Contains(k int) bool

func (*BSTMap) Get

func (m *BSTMap) Get(k int) interface{}

func (*BSTMap) IsEmpty

func (m *BSTMap) IsEmpty() bool

func (*BSTMap) Len

func (m *BSTMap) Len() int

func (*BSTMap) Remove

func (m *BSTMap) Remove(k int) interface{}

func (*BSTMap) Set

func (m *BSTMap) Set(k int, newVal interface{})

type TreeNode

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

Jump to

Keyboard shortcuts

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