algo/go/24_tree/TreeNode.go
leotyliu(刘天一) ccf862c519 BST by golang
2018-11-15 16:07:29 +08:00

18 lines
288 B
Go

package _4_tree
import "fmt"
type Node struct {
data interface{}
left *Node
right *Node
}
func NewNode(data interface{}) *Node {
return &Node{data: data}
}
func (this *Node) String() string {
return fmt.Sprintf("v:%+v, left:%+v, right:%+v", this.data, this.left, this.right)
}