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).


Exercises

  1. 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.

  2. 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