btree

package
v0.0.0-...-de2953b Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEdgeMap

func GetEdgeMap(h *Node, edgeMap map[int][2]*Node, l int)

获取每层的最左和最右节点.

func GetHeight

func GetHeight(bt *Node, l int) int

func IsBST

func IsBST(bt *Node) (res bool)

是否为搜索二叉树:中序遍历为升序.

func IsBalanceTree

func IsBalanceTree(bt *Node) (r bool)

是否为平衡二叉树,左右子树高差不超过1.

func IsCBT

func IsCBT(bt *Node) bool

func PrintTree

func PrintTree(bt *Node)

Types

type Node

type Node struct {
	Left, Right *Node
	Value       int
}

Jump to

Keyboard shortcuts

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