Tutorial 13: Sorting Algorithms
Introduction
This tutorial consists of a few exercises designed to reinforce your understanding of
the sorting algorithms we have studied so far (Sorting Taxonomy and
source code).
- Selection sort as a special case of quick sort.
- Merge sort as an example of an easy-split/hard-join sorting algorithm.
Exercises
- Copy SelectionSorter.java from Sorting Taxonomy and
source code to your local directory. Rewrite the split
method using a for loop (instead of a while loop). Test your code.
- Copy MergeSort.java from Sorting Taxonomy and
source code to your local directory. The code is heavily commented for you to
study and complete. Fill in the code for join, merge, and
mergeHelp as indicated by the comments. Test your code.
D. X. Nguyen, Nov. 29, 1999.
dxnguyen@cs.rice.edu