title: Storing set of non-overlapping ranges and finding whether a value is present in any one of the ranges strictly
body: <p>I have a set of ranges :</p>
  
  <p>Range1 ---- (0-10)</p>
  
  <p>Range2 ---- (15-25)</p>
  
  <p>Range3 ---- (100-1000)  and likewise.
  I would like to have only the bounds stored since storing large ranges , it would be efficient.</p>
  
  <p>Now I need to search for a number , say 14 . In this case, 14 is not present in any of the ranges whereas (say a number) 16 is present in one of the ranges.</p>
  
  <p>I would need a function </p>
  
  <pre><code>bool search(ranges, searchvalue)
  {
      if searchvalues present in any of the ranges
          return true;
      else
          return false;
  }
  </code></pre>
  
  <p>How best can this be done ? This is strictly non-overlapping and the important criteria is that the search has to be most efficient.</p>