Question: Given an array of windows in the plane, we want to count how many overlapping and how many enclosing pairs of windows there are

Given an array of windows in the plane, we want to count how many overlapping and how many enclosing pairs of windows there are (without double counting). A window is the region of the plane enclosed by a rectangle with sides parallel to the x and y axes. A window can be abstracted as an object with the 4 fields of doubles: (left, right, bottom, top). These fields should satisfy the invariant: left < right and bottom top. The window is the Cartesian product of the x-interval [left, right] and the y-interval [bottom, top], i.e., the set of points (x,y) in the plane such that left
Step by Step Solution
3.50 Rating (153 Votes )
There are 3 Steps involved in it
To tackle this problem well implement a Window class in Java that fulfills the specified requirements 1 Fields left right bottom top all protected doubles 2 Constructor Throws InvalidWindowException i... View full answer
Get step-by-step solutions from verified subject matter experts
