Sorting algorithms can be classiied in many diierent ways. The way presented here is by expressing the algorithms as functional programs and to classify them by means of their recursion patterns. These patterns on their turn can be classiied as the natural recursion patterns that destruct or construct a given data-type, the so called cata-and anamorphisms respectively. We show that the selection of the recursion pattern can be seen as the major design decision, in most cases leaving no more room for more decisions in the design of the sorting algorithm. It is also shown that the use of alternative data structures may lead to new sorting algorithms. This presentation also serves as a gentle, lightweight , introduction into the various morphisms.
[1]
Richard S. Bird,et al.
Algebra of programming
,
1997,
Prentice Hall International series in computer science.
[2]
Robert E. Tarjan,et al.
The pairing heap: A new form of self-adjusting heap
,
2005,
Algorithmica.
[3]
Niklaus Wirth,et al.
Algorithms + Data Structures = Programs
,
1976
.
[4]
Maarten M. Fokkinga,et al.
Law and order in algorithmics
,
1992
.
[5]
Simon L. Peyton Jones,et al.
Report on the programming language Haskell: a non-strict, purely functional language version 1.2
,
1992,
SIGP.
[6]
A. Augusteijn,et al.
Functional programming, program transformations and compiler construction
,
1993
.