. Sorting algorithms can be classified in many different 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 classified 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, light-weight, introduction into the various morphisms. 1 Introduction In this paper we present several well known sorting algorithms, namely insertion sort, straight selection sort, bubble sort, quick sort, heap sort and merge sort (see e.g. [Knu73, Wir76]) in a non-standard way. We express...
user correction - Legacy Corrections
3rd International Summer School on Advanced Functional Programming, volume 1608 of LNCS