Results 1 -
4 of
4
Constructing Red-Black Trees
, 1999
"... This paper explores the structure of red-black trees by solving an apparently simple problem: given an ascending sequence of elements, construct a red-black tree which contains the elements in symmetric order. Several extreme red-black tree shapes are characterized: trees of minimum and maximum heig ..."
Abstract
-
Cited by 9 (3 self)
- Add to MetaCart
This paper explores the structure of red-black trees by solving an apparently simple problem: given an ascending sequence of elements, construct a red-black tree which contains the elements in symmetric order. Several extreme red-black tree shapes are characterized: trees of minimum and maximum height, trees with a minimal and with a maximal proportion of red nodes. These characterizations are obtained by relating tree shapes to various number systems. In addition, connections to left-complete trees, AVL trees, and half-balanced trees are highlighted. 1 Introduction Red-black trees are an elegant search-tree scheme that guarantees O(log n) worstcase running time of basic dynamic-set operations. Recently, C. Okasaki (1998; 1999) presented an impressively simple functional implementation of red-black trees. In this paper we plunge deeper into the structure of red-black trees by solving an apparently simple problem: given an ascending sequence of elements, construct a red-black tree whic...
Numerical Representations as Higher-Order Nested Datatypes
, 1998
"... Number systems serve admirably as templates for container types: a container object of size n is modelled after the representation of the number n and operations on container objects are modelled after their number-theoretic counterparts. Binomial queues are probably the first data structure that wa ..."
Abstract
-
Cited by 5 (2 self)
- Add to MetaCart
Number systems serve admirably as templates for container types: a container object of size n is modelled after the representation of the number n and operations on container objects are modelled after their number-theoretic counterparts. Binomial queues are probably the first data structure that was designed with this analogy in mind. In this paper we show how to express these so-called numerical representations as higher-order nested datatypes. A nested datatype allows to capture the structural invariants of a numerical representation, so that the violation of an invariant can be detected at compile-time. We develop a programming method which allows to adapt algorithms to the new representation in a mostly straightforward manner. The framework is employed to implement three different container types: binary random-access lists, binomial queues, and 2-3 finger search trees. The latter data structure, which is treated in some depth, can be seen as the main innovation from a data-struct...
Perfect Trees and Bit-reversal Permutations
, 1999
"... A famous algorithm is the Fast Fourier Transform, or FFT. An efficient iterative version of the FFT algorithm performs as a first step a bit-reversal permutation of the input list. The bit-reversal permutation swaps elements whose indices have binary representations that are the reverse of each othe ..."
Abstract
-
Cited by 4 (2 self)
- Add to MetaCart
A famous algorithm is the Fast Fourier Transform, or FFT. An efficient iterative version of the FFT algorithm performs as a first step a bit-reversal permutation of the input list. The bit-reversal permutation swaps elements whose indices have binary representations that are the reverse of each other. Using an amortized approach this operation can be made to run in linear time on a random-access machine. An intriguing question is whether a linear-time implementation is also feasible on a pointer machine, that is in a purely functional setting. We show that the answer to this question is in the affirmative. In deriving a solution we employ several advanced programming language concepts such as nested datatypes, associated fold and unfold operators, rank-2 types, and polymorphic recursion. 1 Introduction A bit-reversal permutation operates on lists whose length is n = 2 k for some natural number k and swaps elements whose indices have binary representations that are the reverse of eac...
Perfect Trees and Bit-Reversal Permutations
, 1999
"... A famous algorithm is the Fast Fourier Transform, or FFT. An ecient iterative version of the FFT algorithm performs as a rst step a bit-reversal permutation of the input list. The bit-reversal permutation swaps elements whose indices have binary representations that are the reverse of each other. U ..."
Abstract
- Add to MetaCart
A famous algorithm is the Fast Fourier Transform, or FFT. An ecient iterative version of the FFT algorithm performs as a rst step a bit-reversal permutation of the input list. The bit-reversal permutation swaps elements whose indices have binary representations that are the reverse of each other. Using an amortized approach this operation can be made to run in linear time on a random-access machine. An intriguing question is whether a linear-time implementation is also feasible on a pointer machine, that is in a purely functional setting. We show that the answer to this question is in the armative. In deriving a solution we employ several advanced programming language concepts such as nested datatypes, associated fold and unfold operators, rank-2 types, and polymorphic recursion.

