CSE 241: Java Provided Code for Lab 1


The following files are being provided. This zip file contains all of the files listed below.

o Lab1.java --- the driver, you must make some very small changes that are clearly marked at the top of the file

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

o XYPoint.java --- class for a two-dimensional point

o PointPair.java --- class for a pair of points

o PointReader.java --- class to read points from a file

o ClosestPair.java --- This is where you'll put your implementation of your closest pair algorithms

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.

o sample-pointfile --- A sample point file for a data set with five points.


Return to the CSE 241 Home Page