This is an implementation of a Kd-Tree data structure.

A kd-tree for a set P of points in the plane uses O(n) storage and can be built in O(n logn) time.
A rectangular range query on the kd-tree takes O(sqrt(n) + k) time, where k is the number of reported points.

Source Code

Kd-Tree Source Code

Further Resources

Computational Geometry - Algorithms and Applications (great)

If you find any bugs, please contact me to joao | DOT | carreira | AT | ist | DOT | utl | DOT | pt