Fast algorithm to find all points inside a rectangle
问题 Given a set of distinct points in 2D space, and a rectangle (coordinates of all four points, sides parallel with xy axis) how can I quickly find which points are inside the rectangle? I'm not interested in the basic solution of going through all points and seeing which one is inside the rectangle. What I'm looking for is an algorithm which will give me fast query times per rectangle. I don't care how much time I spend in the preprocessing step. What I do care is that after I process my data I