KdTree.java: Implementing the nearest API with recursion