Keep nodes in leafs

This commit is contained in:
Thomas Forgione 2018-03-20 16:01:01 +01:00
parent 5f78e5fc5f
commit 2dc25e95f8
No known key found for this signature in database
GPG Key ID: C75CD416BD1FFCE1
2 changed files with 7 additions and 1 deletions

View File

@ -39,4 +39,10 @@ fn main() {
);
println!("{}", kdtree);
kdtree.traverse_leaves(&mut |locations, elements| {
for element in elements {
println!("{}", element);
}
});
}

View File

@ -58,7 +58,7 @@ impl<T: Clone> KdTree<T> where {
// Build the left and right branches
let mut left = vec![];
for i in &points[0..delimiter] {
for i in &points[0..delimiter + 1] {
left.push(i.clone());
}