Abstract

We show that the internal path length of a red-black tree of size N is bounded above by 2N(log N−log log N)+O(N) and that this is, asymptotically, tight. This result further affirms a conjecture that whenever trees of size N, in a class of height-balanced binary trees, have height bounded from above by αlog2N, then the internal path length is bounded from above by α(log2N−log2 log2N)+O(N). We also prove that the asymptotic bound is tight for red-black trees. For this purpose, we introduce a class of red-black trees, the C(k, h) trees, which achieve the bound when k=h−2logh+e, where |e|≤1/2. This result solves the open problem of how bad red-black trees can be. In order to establish this result, we also prove that any red-black tree of a given height can be produced from a “skinniest” red-black tree of the same height by a series of simple insertions.

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

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.