generated from karl/cpp-template
Fix inserted point not being removed from list
This commit is contained in:
parent
80d6a27eef
commit
2ce6b06e54
2
kdtree.h
2
kdtree.h
@ -98,7 +98,7 @@ class KDTree {
|
||||
|
||||
// TODO: This copies. Can we split the vector into two without copying?
|
||||
std::vector<Point *> left_of_median(points.begin(), points.begin() + middle);
|
||||
std::vector<Point *> right_of_median(points.begin() + middle, points.end());
|
||||
std::vector<Point *> right_of_median(points.begin() + middle + 1, points.end());
|
||||
|
||||
// Create node, recursively call to construct subtree
|
||||
return new Node(axis, median, build(left_of_median, depth + 1),
|
||||
|
Loading…
x
Reference in New Issue
Block a user