Computer Science 501
Data Stuctures and Algorithm Analysis

Fall 2013, The College of Saint Rose

Lab 5: Sorting With Comparators
Due: 6:00 PM, Wednesday, October 23, 2013

This week's lab is designed to introduce (or reintroduce) the power of Java's Comparator interface as it applies to writing a generalized sorting method. You will extend the functionality of an existing class using inheritance, you will implement a simple sorting procedure within this extension, and you will learn about Comparators, which provide a more flexible mechanism for ordering objects than the Comparables we have seen in class.

You may work alone or with a partner on this lab. Of course, collaboration with your partner is unrestricted. You may discuss the lab with your classmates and give and receive some help, but your submission must be your own work (or that of you and your partner, if you choose to pair up with a classmate).

Lab Program

Do the laboratory at the end of Chapter 6 in Bailey.

Please note the following clarifications, modifications, and explanations relating to the lab procedure outlined in the text:

Thought Questions

Answer the thought questions at the end of the lab. Include your responses in the README file described below.

Submitting Your Work

When you're finished, create a tar or zip file (or some similar archiving format) that includes the following:

Before 6:00 PM, Wednesday, October 23, 2013, submit your Java program for grading. There are two things you need to do to complete the submission: (i) upload a copy of your tar or zip file (for your program, please include .java files only, no .class files) using Submission Box under assignment "Comparators", and (ii) print and turn in a hard copy of your program.

Don't forget to check your programs for compliance with the Style Guide for CSC 501 Programs

Grading

Grading Breakdown

Program design 2 points
Program style 3 points
Program documentation 5 points
Program correctness: MyVector 6 points
Program correctness: Comparators 5 points
Program correctness: sorting applications 3 points
"Interestingness" of sorting applications 2 points
Thought questions 4 points