Original link: TreeSet and TreeMap
References: Data structures-common tree red-black Trees:
A red-black tree is an approximately balanced two-fork lookup tree that ensures that the height difference between the left and right subtrees of any one node does not exceed that of the lower of the two. Specifically, the red-black tree is a two-fork lookup tree (binary search trees) that satisfies the following criteria:
Each node is either red or black. The root node must be a black red node that cannot be contiguous (i.e., the children and fathers of the red node cannot be red). For each node, any path from that point to null (the end of the tree) contains the same number of black nodes
L:
Right Rotation:
successor:
The right subtree of T is not empty, then the successor of T is the smallest element in its right subtree. T's right child is empty, then T's successor is its first left-to-go ancestor.
Getentry
put
Adjusted