v2

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: 4 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)

向二分搜索树中插入元素

func (*BST) Contains

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

func (*BST) InOrder

func (b *BST) InOrder()

二分搜索树的中序遍历

func (*BST) IsEmpty

func (b *BST) IsEmpty() bool

func (*BST) Len

func (b *BST) Len() int

func (*BST) LevelOrder

func (b *BST) LevelOrder()

二分搜索树的层序遍历

func (*BST) Maximum

func (b *BST) Maximum() int

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

func (*BST) Minimum

func (b *BST) Minimum() *TreeNode

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

func (*BST) PostOrder

func (b *BST) PostOrder()

二分搜索树的后序遍历

func (*BST) PreOrder

func (b *BST) PreOrder()

二分搜索树的前序遍历

func (*BST) PreOrderNR

func (b *BST) PreOrderNR()

func (*BST) Remove

func (b *BST) Remove(k int)

func (*BST) RemoveMax

func (b *BST) RemoveMax() int

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

func (*BST) RemoveMin

func (b *BST) RemoveMin() *TreeNode

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

func (*BST) String

func (b *BST) String() string

type TreeNode

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

func (*TreeNode) String

func (n *TreeNode) String(depth int) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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