traversal

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CounterClockWise

func CounterClockWise(bt *btree.Node) (res []int)

逆时针打印树边界节点.

func CounterClockWise2

func CounterClockWise2(bt *btree.Node) (res []int)

逆时针打印树边界节点(根节点,树左边界延伸,叶子节点,右边界延伸).

func InOrder

func InOrder(bt *btree.Node) (res []int)

func InOrderRecur

func InOrderRecur(bt *btree.Node) (res []int)

中序遍历:左,根,右.

func IsPosOrderArr

func IsPosOrderArr(arr []int) bool

BST post order arr check.

func LastOrder1

func LastOrder1(bt *btree.Node) (res []int)

func LastOrder2

func LastOrder2(bt *btree.Node) (res []int)

func LastOrderRecur

func LastOrderRecur(bt *btree.Node) (res []int)

后序遍历:左,右,根.

func MorrisIn

func MorrisIn(bt *btree.Node) (res []int)

func MorrisLast

func MorrisLast(bt *btree.Node) (res []int)

func MorrisPre

func MorrisPre(bt *btree.Node) (res []int)

func PosOrderArrToBST

func PosOrderArrToBST(arr []int) (bt *btree.Node)

func PreOrder

func PreOrder(bt *btree.Node) (res []int)

func PreOrderRecur

func PreOrderRecur(bt *btree.Node) (res []int)

先序遍历:根,左,右.

func PrintByLevel

func PrintByLevel(bt *btree.Node)

func PrintByZigZag

func PrintByZigZag(bt *btree.Node)

func ReconByLevel

func ReconByLevel(res string) (bt *btree.Node)

层级遍历反序列化.

func ReconByPre

func ReconByPre(s string) (bt *btree.Node)

func SerialByLevel

func SerialByLevel(bt *btree.Node) (res string)

层级遍历序列化.

func SerialByPre

func SerialByPre(bt *btree.Node) (s string)

func SortedArrToBST

func SortedArrToBST(arr []int) *btree.Node

Types

This section is empty.

Jump to

Keyboard shortcuts

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