in reply to Re: Range overlap (with a lot of ranges)
in thread Range overlap (with a lot of ranges)
To query this structure, do binary search based upon start of range (wind up at same point as if you were "inserting" something into this array before the range), then look forward in the array until it is no longer possible for the sought for range to be in the current range of possible ranges (your start is > start of current 1st element in this "row". So binary search and some further number of comparisons to decide that it is no longer possible to match. This assumes that the ranges can be sorted by "start of range", which it appears that they can be.
so you will have 1 million pointers to array (AoA), each "row" has 2 elements, start and end of that range.