Documentation
¶
Index ¶
- type Node
- type Tree
- func (t *Tree) AnnotatedString() string
- func (t *Tree) Delete(node *Node)
- func (t *Tree) Find(index int) (*Node, int)
- func (t *Tree) IndexOf(node *Node) int
- func (t *Tree) Insert(node *Node) *Node
- func (t *Tree) InsertAfter(prev *Node, node *Node) *Node
- func (t *Tree) Splay(node *Node)
- func (t *Tree) String() string
- func (t *Tree) UpdateSubtree(node *Node)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is weighted binary search tree which is based on Splay tree. original paper on Splay Trees:
func (*Tree) AnnotatedString ¶
AnnotatedString returns a string containing the metadata of the Node for debugging purpose.
func (*Tree) InsertAfter ¶
InsertAfter inserts the node after the given previous node.
func (*Tree) UpdateSubtree ¶
UpdateSubtree recalculates the weight of this node with the value and children.
Click to show internal directories.
Click to hide internal directories.