In my Java implementation of Lab 1, is it possible for me to call the closestPair method without instantiating a FastClosestPair object?
Yes. Suppose that your closestPair method returns a double. Then you can make it a public static method by using: public static double closestPair(XYPoint[] ptsByX, XYPoint[] ptsByY){ Put your method here… Also, of course you can pick whatever variable names you want for the two arrays. } Then, for example, your call from Lab1.java would look like: double ans = FastClosestPair.
Related Questions
- In my Java implementation of Lab 1, is it possible for me to call the closestPair method without instantiating a FastClosestPair object?
- For my Java implementation of Lab 1, do I have to implement the closest pair procedure as a static method?
- Are there any plans to release a C++/Java/Object Oriented implementation of Gerris?