Purely functional 1-2 brother trees

  • Authors:
  • Ralf Hinze

  • Affiliations:
  • Computing laboratory, university of oxford, wolfson building, parks road, oxford ox1 3qd, england (e-mail: ralf.hinze@comlab.ox.ac.uk)

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

Quantified Score

Hi-index 0.00

Visualization

Abstract

Enter the computing arboretum and you will find a variety of well-studied trees: AVL trees (Adel'son-Vel'skiĭ & Landis 1962), symmetric binary B-trees (Bayer 1972), Hopcroft's 2-3 trees (Aho et al. 1974), the bushy finger trees (Guibas et al. 1977) and the colourful red-black trees (Guibas & Sedgewick 1978). In this pearl, we look at a more exotic species of balanced search trees, 1-2 brother trees (Ottmann et al. 1979), which deserves to be better known. Brother trees lend themselves well to a functional implementation with deletion (Section 5) as straightforward as insertion (Section 3), both running in logarithmic time. Furthermore, brother trees can be constructed from ordered lists in linear time (Section 4). With some simple optimisations in place, this implementation of search trees is one of the fastest around. So, fasten your seat belts.