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

Method get

05Lab-Kd Tree/KdTree.java:68–76  ·  view source on GitHub ↗
(Node x, Point2D p, boolean isXPartition)

Source from the content-addressed store, hash-verified

66 }
67
68 private Point2D get(Node x, Point2D p, boolean isXPartition) {
69 if (p == null) throw new IllegalArgumentException();
70 if (x == null) return null;
71 if (p.compareTo(x.p) == 0) return x.p;
72 int cmp = isXPartition ? Double.compare(p.x(), x.p.x())
73 : Double.compare(p.y(), x.p.y());
74 if (cmp < 0) return get(x.left, p, !isXPartition);
75 else return get(x.right, p, !isXPartition);
76 }
77
78 // draw all points to standard draw
79 public void draw() {

Callers 11

containsMethod · 0.95
WordNetMethod · 0.45
distanceMethod · 0.45
sapMethod · 0.45
winsMethod · 0.45
lossesMethod · 0.45
remainingMethod · 0.45
againstMethod · 0.45
FFFNMethod · 0.45
isTrivialEliminatedMethod · 0.45
energyMethod · 0.45

Calls 1

compareToMethod · 0.45

Tested by

no test coverage detected