### BibTeX

@MISC{Sedgewick_left-leaningred-black,

author = {Robert Sedgewick},

title = {Left-leaning Red-Black Trees},

year = {}

}

### OpenURL

### Abstract

The red-black tree model for implementing balanced search trees, introduced by Guibas and Sedgewick thirty years ago, is now found throughout our computational infrastructure. Red-black trees are described in standard textbooks and are the underlying data structure for symbol-table implementations within C++, Java, Python, BSD Unix, and many other modern systems. However, many of these implementations have sacrificed some of the original design goals (primarily in order to develop an effective implementation of the delete operation, which was incompletely specified in the original paper), so a new look is worthwhile. In this paper, we describe a new variant of redblack trees that meets many of the original design goals and leads to substantially simpler code for insert/delete, less than one-fourth as much code as in implementations in common use. All red-black trees are based on implementing 2-3 or 2-3-4 trees within a binary tree, using red links to bind together internal nodes into 3-nodes or 4-nodes. The new code is based on combining three ideas: • Use a recursive implementation. • Require that all 3-nodes lean left.

### Citations

8563 |
Introduction to Algorithms
- Cormen, Leiserson, et al.
- 1990
(Show Context)
Citation Context ...-4 trees, AVL trees, and B trees. This paper is largely self-contained for people familiar with balanced-tree algorithms; others can find basic definitions and examples in a standard textbook such as =-=[6]-=-, [9], or [13]. In [7], Guibas and Sedgewick showed that all of these algorithms can be implemented with red-black trees, where each link in a BST is assigned a color (red or black) that can be used t... |

271 | An Introduction to the Analysis of Algorithms
- Sedgewick, Flajolet
- 1996
(Show Context)
Citation Context ...igh when k is near N/2. The figure at left shows the result of computing the distribution exactly for small N and estimating its shape for intermediate values of N. Following the format introduced in =-=[10]-=-, the curves are normalized on the x axis and slightly separated on the y axis, so that convergence to a distribution can be identified. The irregularities in the curves are primarily (but not complet... |

231 |
R.: A dichromatic framework for balanced trees
- Guibas, Sedgewick
- 1978
(Show Context)
Citation Context ...nd B trees. This paper is largely self-contained for people familiar with balanced-tree algorithms; others can find basic definitions and examples in a standard textbook such as [6], [9], or [13]. In =-=[7]-=-, Guibas and Sedgewick showed that all of these algorithms can be implemented with red-black trees, where each link in a BST is assigned a color (red or black) that can be used to control the balance,... |

179 | An algorithm for the organization of information - Adelson-Velskii, Landis - 1962 |

122 |
Envisioning information. Graphics
- Tufte
- 1990
(Show Context)
Citation Context ...g problems in the analysis of algorithms. In this paper, we present experimental results that may help guide the development of such a model, using a modified form of a plot format suggested by Tufte =-=[12]-=-. Specifically, we use • a gray dot to depict the result of each experiment • a red dot to depict the average value of the experiments for each tree size • black line segments to depict the standard d... |

114 | Symmetric binary B-trees: Data structure and maintenance algorithms - Bayer - 1972 |

25 |
Data Structure & Problem Solving Using Java
- Weiss
- 2006
(Show Context)
Citation Context ... trees, and B trees. This paper is largely self-contained for people familiar with balanced-tree algorithms; others can find basic definitions and examples in a standard textbook such as [6], [9], or =-=[13]-=-. In [7], Guibas and Sedgewick showed that all of these algorithms can be implemented with red-black trees, where each link in a BST is assigned a color (red or black) that can be used to control the ... |

21 | Balanced search trees made simple
- Andersson
- 1993
(Show Context)
Citation Context ...ases to consider. The rotate-on-the-way up strategy simplifies the code (and our understanding of it) by combining various cases in a natural way. Neither idea is new (the first was used by Andersson =-=[2]-=- and the second is used in [9]) but in combination they surprisingly effective in reducing the amount of code required for several versions of the data structure. The code in black on the next page de... |

12 |
private communication
- Seidel
(Show Context)
Citation Context ...tation of delete() that dervies from this discussion is given on the facing page. It uses one-third to one-quarter the amount of code found in typical implementations. It has been demonstrated before =-=[2, 11, 13]-=- that maintaining a field in each node containing its height can lead to code for delete that is similarly concise, but that extra space is a high price to pay in a practical implementation. With LLRB... |

11 | Fringe analysis revisited - Baeza-Yates - 1995 |

1 |
Some observations on 2-3
- Brown
- 1979
(Show Context)
Citation Context ...ntations in 4-nodes), the correspondence is not necessarily 1-1. For clarity in our code, we use a boolean variable (a single bit) to encode the color of a link in the node it points to, though Brown =-=[5]-=- has pointed out that we can mark nodes as red by switching their pointers, so that we can implement red-black trees without any extra space. One of the most important feature of red-black trees is th... |

1 | On random 2-3 trees, Acta Informatica 9 - Yao - 1978 |