Create a structure which is used to hold the coordinates of a rectangle within an two dimensional coordinate system.
Now, add the code necessary to support the following:
- An arbitrary number of rectangles (think “windows”)
- Rectangles that are layered and overlap (and of course various sizes)
- Determine the window/rectangle in which a point is contained (factor in layering)
Are there any optimizations?
How would you handle non-rectangular windows efficiently?
[…] Question #8 […]