Question: PROBLEM DESCRIPTION: A point, P, is an ordered pair of coordinates, P = X Y. A rectangle, R, is defined by its upper left and
PROBLEM DESCRIPTION: A point, P, is an ordered pair of coordinates, P = X Y. A rectangle, R, is defined by its upper left and lower right points, R = (PU PL) = (XU YU XL YL).
Given a list of N points, L = (R1 R2 R3 RN), return the list of intersecting rectangles for each rectangle in L. Rectangles that share a point and/or edge are considered to intersect.
Example: Given L = ( (3 12 9 5) (7 7 12 2) (8 11 12 9) (12 5 16 3)), return: ( ( (7 7 12 2) (8 11 12 9) ) ( (3 12 9 5) ) ( (3 12 9 5) ) ( ) ).
Program it in Racket.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
