MCPcopy Create free account
hub / github.com/MolinDeng/Princeton-algs4 / insert

Method insert

LabEnv/05Lab/KdTree.java:36–41  ·  view source on GitHub ↗
(Point2D p)

Source from the content-addressed store, hash-verified

34
35 // add the point to the set (if it is not already in the set)
36 public void insert(Point2D p) {
37 if (p == null) throw new IllegalArgumentException();
38 if (contains(p)) return;
39 root = put(root, p, true, 0, 0, 1, 1);
40 n++;
41 }
42
43 private Node put(Node x, Point2D p, boolean isXPartition, double xmin, double ymin, double xmax,
44 double ymax) {

Callers 5

mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
SolverMethod · 0.45

Calls 2

containsMethod · 0.95
putMethod · 0.95

Tested by

no test coverage detected