Created
August 19, 2020 20:06
-
-
Save esys/dadd341bc13b0d1e031f8f332dcb641a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Node struct { | |
Data int | |
Left *Node | |
Right *Node | |
} | |
func NewNode(data int) *Node { | |
return &Node{data, nil, nil} | |
} | |
func (n *Node) Process() { | |
time.Sleep(2 * time.Second) // doing some time consuming things | |
fmt.Print(n.Data, " ") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment