CS 241: Java Provided Code for Lab 1


Here is a single file that contains all of the files described< below. Just save it and then unzip it (use WinZip on the PCs, unzip in unix, and an standard unzip program on other platforms).

o java-lab1-all.zip


The following files are being provided:
o Lab1.java --- the portion of the driver provided is here

o Sort.java --- this is called to do the sorting neededin preprocesing

o XYPoint.java --- code for XYPoint class

o FastClosestPair.java --- This is where you'll put your implementation of the divde-and-conquer closest pair algorithm

o Comparator.java --- This is a class used to give the sort routine a comparison function to compare two points

o XComparator.java --- This implements Comparator so the x-coordinate is used to compare the two points

o YComparator.java --- This implements Comparator so the y-coordinate is used to compare the two points

o Terminal.java --- This is the provided terminal class to get input and output from a command line or from a file. Note that the provided driver demonstrates how a command line argument can be used to have the output go to a transcript file and/or the input read from a provided file

o Plotter.java --- This is the provided routine to plot the points. It should be be helpful when you are debugging.


Return to the CS 241 Home Page