Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BSTInterface ¶
type BSTInterface interface {
// Adds new elem to the tree, will not check if same val already exists
Insert(interface{}) *Node
// Returns the first node that matches
Search(interface{}) *Node
// In-order traversal of tree copied to slice
ToSlice() []interface{}
// In-order traversal of tree, calling the func for each element visited
Traverse(func(interface{}))
}
Binary Search Tree implementation https://en.wikipedia.org/wiki/Binary_search_tree Element comparison is based on OrderFunc provided to NewBST method
Click to show internal directories.
Click to hide internal directories.