CMPS 144 Spring 2019
Prog. Assg. #4: Generic Partitioning and Recursive QuickSort
Due: 11:59pm, Monday, April 15

Summary

The task before you is to

  1. Complete two classes that implement the java.util.Comparator interface and that define two different orderings on values of type String.

    Note: An ordering on a type is defined by a set of criteria by which it can be determined, for any pair of elements (x,y) of that type, which one of x<y, x=y, or x>y holds. Technically, to be an ordering, not only must exactly one of those expressions be true, but also it must be that x=y implies y=x (i.e., equality is symmetric) and that < is transitive (which is to say that if both x<y and y<z, then necessarily x<z.) End of note.

  2. Modify a non-generic class whose instances can partition an array (or array segment) of Integer values to make it generic. The result will be a class such that, for any object/reference type T, and for any ordering that can be defined on type T, it is possible to create an instance of the new class that is capable of partitioning an array of type T[] in a manner consistent with that ordering.

  3. Supply the body of a method that implements the classic recursive QuickSort algorithm.

The details follow.


Java Classes that you are given


Java classes you are to complete


Program Submission

Use the file submission system (see the link near the top of the course web page) to submit into the prog4_dir folder the four Java classes that you were responsible for completing. Make sure to insert the standard comments near the top of each class. These should include your name, a list of names of persons who aided you in your work, and a description of any defects. If there are defects of which you are unaware, it probably means that you did a poor job of testing your work. Thus, of two submissions having similar defects, one in which those defects are acknowledged deserves a better grade than one in which they are not acknowledged.