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.
KeywordsBinary Tree Leaf Tree Recursive Call Sorting Algorithm Recursive Structure
Unable to display preview. Download preview PDF.
- 1.Augusteijn, L.: Functional Programming, Program Transformations and Compiler Construction. PhD thesis, Eindhoven Technical University (October 1993)Google Scholar
- 2.Bird, R.S., de Moor, O.: Algebra of Programming. Prentice-Hall, Englewood Cliffs (1994)Google Scholar
- 4.Fokkinga, M.M.: Law and order in algorithmics. PhD thesis, Twente University (1992)Google Scholar
- 6.Hudak, P., Wadler, P., Brian, A., Fairbairn, B.J., Fasel, J., Hammond, K., Hughes, J., Johnsson, T., Kieburtz, D., Nikhil, R., Jones, S.P., Reeve, M., Wise, D., Young, J.: Report on the Programming Language Haskell, A Non-Strict, Purely Functional Language, Version 1.2. In: ACM SIGPLAN, vol. 27(5)-Section R (1992)Google Scholar
- 7.Jones, M.P., Peterson, J.C.: Hugs 1.4 User Manual, Included as part of the Hugs distribution (November 1998), http://www.cs.nott.ac.uk/mpj/hugs14/
- 8.Knuth, D.E.: The Art of Computer Programming, vol. 3. Addison-Wesley, Reading (1973) (Sorting and Searching)Google Scholar
- 9.Meijer, E.: Calculating Compilers. PhD thesis, Utrecht State University, Utrecht, The Netherlands (1992)Google Scholar
- 10.Watson, B.W.: Taxonomies and Toolkits of Regular Language Algorithms. PhD thesis, Eindhoven University of Technology (1995)Google Scholar