K-d tree: Difference between revisions

Content added Content deleted
(Updated output first D entry)
Line 431: Line 431:


Visited an average of 43.10 nodes on 10000 searches in 213ms.</pre>
Visited an average of 43.10 nodes on 10000 searches in 213ms.</pre>

{{out|Output, using the ldc2 compiler}}
<pre>Wikipedia example data:
Point: const(Point!(2, double))([9, 2])
Nearest neighbor: immutable(Point!(2, double))([8, 1])
Distance: 1.41421
Nodes visited: 3

k-d tree with 400000 random 3D float points (construction time: 306ms):
Point: const(Point!(3, float))([0.22012, 0.984514, 0.698782])
Nearest neighbor: immutable(Point!(3, float))([0.225766, 0.978981, 0.69885])
Distance: 0.00790531
Nodes visited: 54

Visited an average of 43.10 nodes on 10000 searches in 47ms.</pre>


===Faster Alternative Version===
===Faster Alternative Version===