Hi,
I have a programming problem which I want to share with you and hope you may have some ideas.
Problem statement
Define many number ranges in the form min->max,
where min, max are positive integers from 0 to 9999.
Implement a method such that given a list of number ranges, it will return true if non of the ranges intersect and false otherwise.
e.g. f ( 123..500, 499..700 ) returns true
f ( 123..500, 501..600, 601..800 ) returns false
Here is my current design.
One problem with this is that I need to create the individual numbers in the ranges as objects and throw them into the Set. So if the range is huge; then it becomes very memory intensive.
Any other ideas ?
Regards,
Pho