Skip to main content
    • Aa
    • Aa

Purely Functional 1-2 Brother Trees

  • RALF HINZE (a1)

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.

Hide All
R. Bayer (1972) Symmetric binary B-trees: Data structure and maintenance algorithms, Acta Inform., 1: 290306.

R. Bird (1998) Introduction to Functional Programming using Haskell. 2nd ed.Prentice Hall.

C. Okasaki (1999) Functional pearl: Red-black trees in a functional setting, J. Funct. Program., 9 (4): 471477.

T. Ottmann , H.-W. Six & D. Wood (1979) On the correspondence between AVL trees and brother trees, Computing, 23, 4354.

C. Reade (1992) Balanced trees with removals: An exercise in rewriting and proof, Sci. Comput. Program., 18 (2): 181204.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 17 *
Loading metrics...

Abstract views

Total abstract views: 74 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 17th October 2017. This data will be updated every 24 hours.