Fastest way to search a number in a list of ranges

前端 未结 5 836
终归单人心
终归单人心 2020-12-19 04:12

I have the following code to find a match for a number in a list of ranges.

public class RangeGroup
{
    public uint RangeGroupId { get; set; }
    public u         


        
5条回答
  •  -上瘾入骨i
    2020-12-19 04:42

    May be use a sorted list and do a binary search. That way you reduce the number of comparisons to O(logN)

提交回复
热议问题