Design a class named NearestPoints that contains methods to solve the nearest point problem using both approaches-Naive and neighbor preserving hash functions

computer science

Description

Java Programming
Design a class named NearestPoints that contains methods to solve the nearest point problem using both approaches— -Naive and neighbor preserving hash functions. This class will have following methods/constructor. Attached the description look at page 3-4.
nearestPoints(String dataFile) The variable dataFile holds the absolute path of the file that contains the set of points S.
nearestPoints(ArrayList<float> pointSet) The array list pointSet contains the set of points S.
naiveNearestPoints(float p) Returns an array list of points (from the set S) that are close to p. This method must implement the naive approach. Note that the type of this method must be ArrayList<float>
buildDataStructure() Builds the data structure that enables to quickly answer nearest point queries. Your data structure must use the notion of neighbor preserving hashing and along with the class HashTable. Otherwise, you will receive zero credit.
npHashNearestPoints(float p) Returns an array list of points (from the S) that are close to p. This method must use the data structure that was built. The expected run time of this method must be O(N(p)); otherwise you will receive zero credit.
allNearestPointsNaive() For every point p 2 S, compute the list of all points from S that are close to p by calling the method NaiveNearestPoints(p). Write the results to a file named NaiveSolution.txt
allNearestPointsHash() For every point p is S, compute the list of all points from S that are close to p by calling the method NPHashNearestPoints(p). WritePthe results to a file named HashSolution.txt. The expected time of this method must be O(n+ p2S N(p)); otherwise you will receive zero credit.
Hey can you do classes HashTable, NearestPoints, and RecSys?


Related Questions in computer science category