blob: 877a2c36582bc86e510dbe0766c62ed17de88467 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
}
}
|