Hello, mDmitriy, you wrote: D> Hello, artelk, you wrote: A>> it is Enough SortedSet with on EndNumber. A>> For search GetViewBetween + FirstOrDefault. D> from here it is possible more in detail? D> argument of search is the number, result - one record in which range it is number enters the Example: Sorted on EndNumber (and simultaneously on FirstNumber, since not intersected) intervals: [1. 5], [7. 13], [14. 25], [30. 42] we Search for an interval which is including a point 20. intervals. GetViewBetween (new Range {EndNumber=20}, intervals. Max) == [14. 25], [30. 42] we Look only the first [14. 25]. Approaches, we return. We search for an interval which is including a point 6. intervals. GetViewBetween (new Range {EndNumber=6}, intervals. Max) == [7. 13], [14. 25], [30. 42] we Look only the first [7. 13]. Does not approach, since FirstNumber it has more 6. I.e. var intervals = new SortedSet <Range> (Comparer <Range>.Cre Create ((x, y) = x. EndNumber. CompareTo (y. EndNumber))); Range Find (int n) {if (intervals. Count == 0) return null; var range = intervals. GetViewBetween (new Range {EndNumber=n}, intervals. Max).FirstOrDefault (); return range! = null && range. FirstNumber <= n? range = null;} Wrote in the browser, recheck the test.