TreeMap and red-black trees in Java

Source: Internet
Author: User

TREEMAP:

http://blog.csdn.net/tobeandnottobe/article/details/7232664

Red and black Trees:

Http://blog.chinaunix.net/uid-26575352-id-3061918.html

In fact, the most important of the red and black trees are:

Nature 1. The nodes are red or black.

Nature 2. The root is black.

Nature 3. All leaves are black (leaves are nil nodes).

Nature 4. Each red node must have two black child nodes. (no two contiguous red nodes can be found on all paths from each leaf to the root.) )

Nature 5. All simple paths from any node to each of its leaves contain the same number of black nodes.

To learn about the red and black trees, you can read about the Wiki encyclopedia:

https://zh.wikipedia.org/zh/%E7%BA%A2%E9%BB%91%E6%A0%91

TreeMap and red-black trees in Java

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.