CSE 241: Java Provided Code for Lab 1


The following files are being provided. All of the java files are together in this zip file.

o Lab1.java --- the driver, you will want to make some small changes for Parts 4 and 5.

o XYPoint.java --- class for a two-dimensional point. No changes should be needed.

o PointPair.java --- class for a pair of points. You might want to add some additional funcionality

o NaiveClosestPair.java --- This is where you'll put your implementation of your naive closest pair algorithms that computes the distance for each pair of points.

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

o Sort.java --- this is called to do the sorting needed in preprocesing. You shouldn't need to change this.

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. You shouldn't need to change this.

o YComparator.java --- This implements Comparator so the y-coordinate is used to compare the two points. You shouldn't need to change this.

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


Return to the CSE 241 Home Page