This is a creation in Article, where the information may have evolved or changed.
Now it is only simple to add, find, traverse. There will be perfect after the time.
Package Mainimport "FMT" type BNode struct {data intleft *bnoderight *bnode}type Tree struct {firstnode *bnode}func (t *tree) printdata (node *bnode) {if node.left! = nil {t.printdata (node.left)}fmt. Println (node.data) if node.right! = nil {t.printdata (node.right)}return}//return Nodefunc (t *tree) Search (data int, BNode *bn Ode) *bnode {if BNode = nil {return nil}if data > Bnode.data {return t.search (data, bnode.right)} else if data < Bn Ode.data {return T.search (data, Bnode.left)} else if data = = Bnode.data {return Bnode}return nil}func (t *tree) Insert (dat A int, CurrentNode *bnode) {newNode: = &bnode{data,nil,nil,}if T.firstnode = nil {T.firstnode = Newnodereturn}if t.Se Arch (data, t.firstnode)! = nil {Panic ("The data already exists") Return}if data > Currentnode.data {if currentnode.right = nil {current Node.right = NewNode} else {T.insert (data,currentnode.right)}} or else if data < Currentnode.data {if currentnode.left = = Nil {currentnode.left = NewNode} else {T.insert (data, CURRENTNODE.LEFT)}}return}func Main () {nodes: = []int{4,1,7,15,10}tree: = Tree{}for _, Data: = Range nodes {tree. Insert (data, tree. Firstnode)}tree. Printdata (tree. Firstnode) fmt. Print (tree. Search (tree). Firstnode))}