diff options
Diffstat (limited to 'Algorithms/Part-I/5-KdTrees/KdTree.java')
-rw-r--r-- | Algorithms/Part-I/5-KdTrees/KdTree.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Algorithms/Part-I/5-KdTrees/KdTree.java b/Algorithms/Part-I/5-KdTrees/KdTree.java new file mode 100644 index 0000000..877a2c3 --- /dev/null +++ b/Algorithms/Part-I/5-KdTrees/KdTree.java @@ -0,0 +1,51 @@ +/* vim: set expandtab tabstop=4 shiftwidth=4 : */ + +public class KdTree +{ + // construct an empty tree of points + public KdTree() + { + } + + // is the tree empty? + public boolean isEmpty() + { + return true; + } + + // number of points in the tree + public int size() + { + return 0; + } + + // add the point p to the tree (if it is not already in the tree) + public void insert(Point2D p) + { + } + + // does the tree contain the point p? + public boolean contains(Point2D p) + { + return false; + } + + // draw all of the points to standard draw + public void draw() + { + } + + // all points in the tree that are inside the rectangle + public Iterable<Point2D> range(RectHV rect) + { + return null; + } + + // a nearest neighbor in the tree to p; null if tree is empty + public Point2D nearest(Point2D p) + { + return null; + } + +} + |