Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { Key Key Value interface{} // contains filtered or unexported fields }
Node - standard node of rb tree. All logic is tied up in the keys comparison,
because of this key must realise Key interface and should not be nil. In Value you can save whatever you want.
type RBTree ¶
type RBTree struct {
// contains filtered or unexported fields
}
RBTree - Black red tree realisation. All last nodes have black leaves with the nil Key.
Algorithm of insertion has been taken from here https://habr.com/ru/company/otus/blog/472040/ Algorithm of remove has been taken from here https://en.wikipedia.org/wiki/Red–black_tree
func (*RBTree) InsertNode ¶
Insert new Node in tree. If Node all ready exists Node.Value will be changed
Click to show internal directories.
Click to hide internal directories.