Learn how a k-d tree works

and how it works for looking for nearest neighbours