Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TraversePreOrder represents pre-order traversal order TraversePreOrder = 0 // TraverseInOrder represents in-order traversal order TraverseInOrder = 1 // TraversePostOrder represents post-order traversal order TraversePostOrder = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
KeyValue represents a key-value pair
type OrderedSymbolTable ¶
type OrderedSymbolTable interface { SymbolTable Min() (Generic, Generic) Max() (Generic, Generic) Floor(Generic) (Generic, Generic) Ceiling(Generic) (Generic, Generic) Rank(Generic) int Select(int) (Generic, Generic) DeleteMin() (Generic, Generic) DeleteMax() (Generic, Generic) RangeSize(Generic, Generic) int Range(Generic, Generic) []KeyValue Traverse(int, VisitFunc) Graphviz() string }
OrderedSymbolTable represents an ordered symbol table (key-value collection)
func NewBST ¶
func NewBST(compareKey Compare) OrderedSymbolTable
NewBST creates a new Binary Search Tree
func NewRedBlack ¶
func NewRedBlack(compareKey Compare) OrderedSymbolTable
NewRedBlack creates a new Red-Black Tree
type SymbolTable ¶
type SymbolTable interface { Size() int Height() int IsEmpty() bool Put(Generic, Generic) Get(Generic) (Generic, bool) Delete(Generic) (Generic, bool) KeyValues() []KeyValue // contains filtered or unexported methods }
SymbolTable represents an unordered symbol table (key-value collection)
Click to show internal directories.
Click to hide internal directories.