关于鼠标选取算法的问题 谢了先!!
One very common operation in the graphical user interface of a computer
program is “picking” ? point the cursor at the item you want and click a
mouse button. But usually there are many items on the screen, and the
program has to decide which has been pointed to. For simplicity, assume
that you only want to pick a point.
i) Design an efficient data structure with the supporting algorithm(s) for
picking a point in a user interface. (Potentially, there can be thousands
of points on the screen, your computer can be slow and your user doesn’t
want to wait. That is, you want the fastest algorithm possible.) State the
assumptions and/or trade-offs, if any, that you have to make in your
design.
(ii) How would you approach the problem of picking a straight line? (Just
discuss the answer conceptually. You don’t have to come up with another
data structure and algorithm.)