What is the fastest way to find closest point to the given point in data array?
For example, suppose I have an array A of 3D points (with coordinates x,
I would use a KD-tree to do this in O(log(n)) time, assuming the points are randomly distributed or you have a way to keep the tree balanced.
http://en.wikipedia.org/wiki/Kd-tree
KD trees are excellent for this kind of spatial query, and even allow you to retrieve the nearest k neighbors to a query point.