tree

package
v0.0.0-...-2159114 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 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
}

结构体 Go中只有封装,没有继承和多态

func CreateNode

func CreateNode(testValue int) *Node

自定义工厂函数

func (Node) Print

func (node Node) Print()

为结构体定义方法 值传递

func (*Node) SetValue

func (node *Node) SetValue(value int)

值传递

func (node Node) SetValue(Value int) {
	node.Value = Value
}

编译器自动识别都地址的值或者指针 指针作为方法的接收者

func (*Node) Traverse

func (node *Node) Traverse()

中序遍历

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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