title: [only equal operator]what are the fast algorithms to find duplicate elements in a collection and group them?
body: <p><strong>Suppose we have a collection of elements, and these elements only have equal operator. So, it's impossible to sort them.</strong></p>
  
  <p>how can you pick out those with duplicates and put them into each group with least amount of comparison? preferably in C++, but algorithm is more important than the language. For Example given {E1,E2,E3,E4,E4,E2,E6,E4,E3}, I wish to extract out {E2,E2}, {E3,E3}, {E4,E4,E4}. what data structure and algorithm you will choose? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My scenario, if binary data 1 is equal to binary data 2 we can say these two elements are identical. But, only <strong>=</strong> and <strong>!=</strong> is logical</p>
  
  <pre><code>element 1:
  
  4 0 obj
  &lt;&lt; /Type /Pages /Kids 5 0 R /Count 1 &gt;&gt;
  stream
  .....binary data 1....
  endstream
  endobj
  
  element 2:
  
  5 0 obj
  &lt;&lt; /Type /Pages /Kids 5 0 R /Count 1 &gt;&gt;
  stream
  .....binary data 2....
  endstream
  endobj
  </code></pre>