You must work with your assigned partner.
This lab assignment is designed to provide insight into the implementation of various sorting algorithms and generic algorithms.
You must implement three sorting algorithms (they should have the same interface as the Collections.sort(List<T> list) algorithm). You must implement InsertionSort, QuickSort, and a hybrid sort that uses QuickSort on any partition with more than 20 elements and InsertionSort for partitions with 20 or fewer elements. Your implementations should be as efficient as possible.
The sorting algorithms should work on any List<T> where T implements the Comparable interface.
In addition, you must write a test program that sorts the words in words.txt. The program should compare all of your sorting algorithms as well as the Collections.sort(List<T> list) algorithm on the following two containers: ArrayList<String> LinkedList<String>.
You must be prepared to demonstrate benchmarking the Collections.sort() method and your implementation of InsertionSort. In addition, log all the time spent on this assignment (for week 3) in the FAST system.
You are required to log all the time spent on this assignment (for week 4) in the FAST system.
Here is a template file to use as a starting point for this report.
Each pair should submit one lab report. Your report must include:
The lab report (one report for each team) should consist of the following:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.
This laboratory was developed by Dr. Chris Taylor.
| © 2001-2006 Dr. Christopher C. Taylor | Office: CC-36C | Phone: 277-7339 |