Want to make sure that the Big O notation i got is correct
<p>I have written this code but I have to find the big O notation. I came up with O(n2) but I am not sure if it is correct. Please somebody help. Thanks</p>

<pre><code>int n = array.length;

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