Abstract

The red-black trees are binary trees in which a longest path from every node v to a leaf is at most twice as long as a shortest path from v to a leaf. We examine sequences of simple insertions (insertions without promotions or any other restructuring operations) in red-black trees. We prove that the case of red-black trees is the same as the class of trees that is defined by an insertion algorithm for red-black trees that uses promotions to restore balance. The proof demonstrates that every red-black tree can be built from the empty tree by a sequence of simple insertions We also prove that every red-black tree contains a skinny red-black subtree of the same height (a red-black tree with the smallest number of nodes for its height) by giving a sequence of simple insertions that can be used to build the given red-black tree from the skinny red-black subtree. From this result we conclude that the skinny red-black trees have the minimum path length among all red-black trees of the same height, a result that seems intuitively obvious but whose proof is not.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call