tree

package
v0.0.0-...-a9cb292 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 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 Node

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

Node 是一个二叉树节点结构

func CreateNode

func CreateNode(value int) *Node

CreateNode 方法用于控制初始化

func (Node) Print

func (node Node) Print()

Print 打印节点的值

func (*Node) SetValue

func (node *Node) SetValue(value int)

SetValue 设置节点 Value 的值

func (*Node) Traverse

func (node *Node) Traverse()

Traverse 中序遍历

func (*Node) TraverseFunc

func (node *Node) TraverseFunc(f func(*Node))

TraverseFunc 中序工具

func (*Node) TraverseWithChannel

func (node *Node) TraverseWithChannel() chan *Node

TraverseWithChannel 使用 channel 进行遍历

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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