Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key interface { // Compare gives the result of a 3-way comparison // a.Compare(b) = 1 => a > b // a.Compare(b) = 0 => a == b // a.Compare(b) = -1 => a < b Compare(k Key) int }
Key represents key of Tree.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is an implementation of Left-learning Red-Black Tree. Original paper on Left-leaning Red-Black Trees:
Invariant 1: No red node has a red child Invariant 2: Every leaf path has the same number of black nodes Invariant 3: Only the left child can be red (left leaning)
Click to show internal directories.
Click to hide internal directories.