To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
Languages
Recent
Show all languages
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Left-leaning red–black tree

From Wikipedia, the free encyclopedia

Left-leaning red–black tree
Typetree
Invented2008
Invented byRobert Sedgewick
Time complexity in big O notation
Operation Average Worst case
Search O(log n) O(log n)
Insert O(log n) O(log n)
Delete O(log n) O(log n)
Space complexity
Space O(n) O(n)

A left-leaning red–black (LLRB) tree is a type of self-balancing binary search tree. It is a variant of the red–black tree and guarantees the same asymptotic complexity for operations, but is designed to be easier to implement.

YouTube Encyclopedic

  • 1/3
    Views:
    8 580
    412 956
    5 123
  • Left Leaning Red Black Trees (part 1)
  • Red-black trees in 4 minutes — The basics
  • Left Leaning Red Black Trees (Part 2)

Transcription

Properties

A left-leaning red-black tree satisfies all the properties of a red-black tree:

  1. Every node is either red or black.
  2. A NIL node is considered black.
  3. A red node does not have a red child.
  4. Every path from a given node to any of its descendant NIL nodes goes through the same number of black nodes.
  5. The root is black (by convention).

Additionally, the left-leaning property states that:

  1. A node must not have a red right child.

Relation to 2–3 trees

In the same way conventional red-black trees are related to 2–3–4 trees, left-leaning red-black trees are isomorphic to 2–3 trees, which are a subtype of 2–3–4 trees. This means that for every left-leaning red-black tree, there is a unique corresponding 2–3 tree, and vice versa. Precisely, each (red left child, black parent) pair corresponds to a degree 3 node in a 2–3 tree, and all other black nodes correspond to degree 2 nodes.

Analysis

All of the red-black tree algorithms that have been proposed are characterized by a worst-case search time bounded by a small constant multiple of log N in a tree of N keys, and the behavior observed in practice is typically that same multiple faster than the worst-case bound, close to the optimal log N nodes examined that would be observed in a perfectly balanced tree.

Specifically, in a left-leaning red-black 2–3 tree built from N random keys:

  • A random successful search examines log2 N − 0.5 nodes.
  • The average tree height is about 2 log2 N
  • The average size of left subtree exhibits log-oscillating behavior.

Bibliography

External links


This page was last edited on 12 April 2024, at 19:16
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.