Red-black trees in a functional setting

  • Authors:
  • Chris Okasaki

  • Affiliations:
  • School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, Pennsylvania 15213, USA

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

Everybody learns about balanced binary search trees in their introductory computer science classes, but even the stouthearted tremble at the thought of actually implementing such a beast. The details surrounding rebalancing are usually just too messy. To show that this need not be the case, we present an algorithm for insertion into red-black trees (Guibas and Sedgewick, 1978) that any competent programmer should be able to implement in fifteen minutes or less.