One of TreeMap source analysis-sort binary tree, balanced binary tree, red and black tree

Source: Internet
Author: User

First, sort binary tree (BST tree)

1. The definition of the sort binary tree

Sort binary tree, binary sort tree

The sort binary tree is either an empty binary tree or a two-fork tree with the following properties:

(1) If its left subtree is not empty, then the value of all nodes on the left subtree is less than the value of its root node;
(2) if its right subtree is not empty, then the value of all nodes on the right subtree is greater than the value of its root node;
(3) Its left and right sub-trees are also sorted binary trees respectively.

By traversing the ordered binary tree in the middle order, the ordered sequence can be obtained from small to large.

Like what

2. Sorting binary tree Insert and delete

Second, balanced binary tree (Balanced binary Tree,avl tree)

Three, red and black trees ()

One of TreeMap source analysis-sort binary tree, balanced binary tree, red and black tree

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.