Improving Space Efficiency for a Family of Operations

In this paper, we show that O(1) space and O(log n) time suffice for merging and splitting of red-black trees in a standard representation in which only two pointers to the two children are given for each node. We also show that the nodes of any binary search tree (in the same representation) whose keys are in a given range can be enumerated in O(1) space using a time-optimal algorithm. Our time-and-space-optimal algorithms for merging and splitting red-black trees are the first that have ever been designed, and they will have lasting value.