in reply to union and intersection of ranges
Do they refer to the LENGTH of the intersection being at least half the length of the union?
Yes, I would think that's what they're after. But you could check with "they", if that's allowable and possible.
Cheers,
Rob
Re^2: union and intersection of ranges
by BillKSmith (Monsignor) on Feb 09, 2023 at 17:07 UTC
|
If you assume that 'ranges' are 'sets', the terms 'union' and 'intersection' are well defined. They are both sets. Marshall has given shown how to compute them directly from the definitions. Perhaps your spec intends for you to compare the cardinality of these sets.
If you assume that 'ranges' are ordered lists, you need LanX's assumptions to make any sense at all. (The calculation is much simpler because it exploits the ordering.)
Fortunately, both sets of assumptions produce the same results.
| [reply] [Watch: Dir/Any] |
|