ECE 144
Homework 6
Due Early Week 7, On-Time Week 8
Last modified: 9/25/02
- Always write the time-complexity (in Big Oh notation) in a comment next to every method or function you write in this class.
- Use the test input and timers from homework 1.
- Note submitting any program that you did not write yourself is plagiarism - a very serious form of cheating.
Anyone caught submitting a homework solution they did not author themselves will be prosecuted to the fullest extend of UCI law. Just as a reminder, please re-read my cheating policy.
Cheating policy.
- (25 points) Implement InsertionSort.
- (25 points) Implement MergeSort.
- (25 points) Implement QuickSort.
- (25 points) Write a driver program that allows the user to test your class implementation. Again use the PCTimer class to measure the sorting time for each of these sorting algorithms:
- fill an array with the words from a specified file (e.g., random.txt)
- t1.start(), sort the words, t1.stop()
- t2.start(), re-sort the sorted words, t2.stop()
- print out (to a user specified file) the times required to sort 1) a random list of words, and 2) a sorted list of words
- Again, be sure your main program takes arguments from the command line for input file name and output file name.
- What to submit:
- Show your TA that your program works as described above.
- Submit (and save) your program for future comparison with the others.