I\'ve got a point in 2d plane for example (x0,y0) and a set of n points (x1,y1)...(xn,yn) and I want to find nearest point to (x0,y0) in a way better than trying all points
Use a quad-tree for 2D http://en.wikipedia.org/wiki/Quadtree