BST

package
v0.0.0-...-3b2a8e7 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 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 BST

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

func New

func New() *BST

func (*BST) Add

func (b *BST) Add(e interface{})

向二分搜索树中添加新的元素 e

func (*BST) Contains

func (b *BST) Contains(e interface{}) bool

看二分搜索树中是否包含元素 e

func (*BST) GetSize

func (b *BST) GetSize() int

func (*BST) InOrder

func (b *BST) InOrder()

二分搜索树的中序遍历

func (*BST) IsEmpty

func (b *BST) IsEmpty() bool

func (*BST) Maximum

func (b *BST) Maximum() interface{}

寻找二分搜索树的最大元素

func (*BST) Minimum

func (b *BST) Minimum() interface{}

寻找二分搜索树的最小元素

func (*BST) PostOrder

func (b *BST) PostOrder()

二分搜索树的后序遍历

func (*BST) PreOrder

func (b *BST) PreOrder()

二分搜索树的前序遍历

func (*BST) Remove

func (b *BST) Remove(e interface{})

从二分搜索树中删除元素为 e 的节点

func (*BST) RemoveMax

func (b *BST) RemoveMax() interface{}

从二分搜索树中删除最小值所在的节点,返回最小值

func (*BST) RemoveMin

func (b *BST) RemoveMin() interface{}

从二分搜索树中删除最小值所在的节点,返回最小值

func (*BST) String

func (b *BST) String() string

type Node

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

Jump to

Keyboard shortcuts

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