in reply to Re: Re: Code efficiency / algorithm
in thread Code efficiency / algorithm

It looks like Set::Infinite and Array::IntSpan could be helpful starting points.

If all the companies had mutually-exclusive ranges, then you could simply place them in an Array::IntSpan and look them up. But since your ranges intersect, you will need to intersect them with each other (using the operations of Set::Infinite like intersects and contains). That's basically what a tree algorithm would do.

  • Comment on Re: Re: Re: Code efficiency / algorithm