2D-Tree is an implementation 2-dimensional tree for range and nearest neighbors searches.
buildTree(List<Node<T>> nodes- builds balanced 2d-treeinsert(T object, double x, double y)- inserts object into the treeinsertOrUpdate(T object, double x, double y)- inserts object if it doesn't exists in the tree otherwise updates the existing objectdelete(T object)- deletes object from the tree
findNearestNeighbour(double x, double y)- finds the nearest neighborfindNearestNeighbours(double x, double y, int k)- finds k nearest neighborsrangeSearch(double x, double y, double radius)- finds neighbors in specified rangerangeSearchKm(double x, double y, double radius)- finds neighbors in specified range assuming thatxis a latitude,y- longitude,radius- radius in km.