Documentation ¶
Overview ¶
Package binary is an implementation of a balanced binary tree. A majority of this code comes from appliedgo. https://appliedgo.net/balancedtree/ https://appliedgo.net/bintree/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyPrint ¶
func PrettyPrint(t Tree)
PrettyPrint takes a Tree value and displays a pretty print version of the tree.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree represents all values in the tree.
func (*Tree) InOrder ¶
InOrder traversal travel from the leftmost node to the rightmost nodes regardless of depth. In-order traversal gives node values in ascending order.
#4 / \ #2 #6 / \ / \ #1 #3 #5 #7
Click to show internal directories.
Click to hide internal directories.