Find the element with highest occurrences in an array [java]
<p>I have to find the element with highest occurrences in a double array.
I did it like this:</p>

<pre><code>int max = 0;
for (int i = 0; i &lt; array.length; i++) {
       int count = 0;
       for (int j = 0; j &lt; array.length; j++) {
         if (array[i]==array[j])
             count++;
   }
  if (count &gt;= max)
      max = count;
 }
</code></pre>

<p>the program works, but it is too slow!! i have to find a better solution, can anyone help me???</p>
