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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!