McMaster University
CAS 706

Assignment 1

Generic Quicksort. Write 3 different versions of quicksort (in each language), which explicitly:

  1. Sort a list of integers in ascending order
  2. Sorts a list of ``anything'' via an externally provided comparison function.
  3. Sorts a list of ``anything'' via an externally provided comparison function, and an externally provided partition function (which itself uses the comparison function).
Your code should also contain executable test cases for each.

For the compilers/interpreters:

  1. D: recommended is dmd 2.0, available from dlang.org.
  2. Ruby: there are different instructions depending on your platform.
  3. Ocaml: instructions for all platforms.
  4. Prolog: I recommend SWI-prolog (which is also installed on mills).
Note that for a number of these languages, your package manager (on Linux or Mac) might allow you to install things even more easily.



Sept. 2014