CSC252 Assignment 1
Thu Jan 25 22:11:26 EST 1996
Your goal in this assignment is to learn the use of Unix Makefiles and separate compilation. To accomplish this you will write a program that sorts an arbitrary number of integers. Your program should have three files. The first file will contain the driver that parses options (in your case the size of the array to sort is the only option). The second file will contain the initialization and printing routines. Use a random number generator to initialize your array. The third file will contain the sorting routine itself. A simple algorithm for sorting (called insertion sort) looks like this:
for i=1 to N
for j=1 to i
if Array[i+1] < Array[j] then
swap(Array[i+1], Array[j]);
If you feel adventurous (and for extra credit) go ahead and implement more than one sorting algorithms (try quicksort, bubblesort, heapsort) and compare their relative performance. Turn in a short writeup describing your experiences, and the location of your code. Do NOT work on your code after the assignment deadline! The assignment is due next Wednesday January 31st. Good luck!