title: What algorithm to use to check if one set overlaps to another?
body: <p>I have many sets of integers. I need to check if one overlaps (at least one same element exists in both sets) to another. What is the best way to do it. I compared two ways:</p>
  
  <pre><code>HashSet&lt;int&gt; hs1, hs2;
  hs1.Overlaps(hs2);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SortedSet&lt;int&gt; ss1, ss2;
  ss1.Overlaps(ss2);
  </code></pre>
  
  <p>HashSet is beter because in both cases overlaps gets enumerable, and do scan in enumerable and lookup in set.</p>
  
  <p>But I feel that beter algorithm exists to check overlaping in sorted sets. </p>
  
  <p><strong>Does anyone know algorithm which allows to quick check overlaping using the fact that both sets is sorted?</strong></p>
  
  <p><strong>UPD1</strong>
  The size of each set is about 100-1000 well distributed integers. </p>