Java-java.util.treemap (red and black tree) __java

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.