Complexity of the algorithm to find occurences of a given number in a given array
If we retain only the references to i and j, the code reduces to

i = 1
j = 1
while i &lt; |A| 
    j = j + 1
    if j &gt; |A|
        i = i + 1
        j = i


This is equivalent to 

for i in [1 |A|]
    for j in [i |A|]


... which is gone through about ${|A|^2 \over 2}$ times. So it is $\Theta(n^2)$: both $O(n^2)$ and $\Omega(n^2)$. 

The algorithm appears to be looking for the maximum number of replicates in the array. There are faster ways to do so. A good hash map has (average) constant time access/update. So you can count how many of each thing are in the array in $\Theta(n)$ time. You can then find the maximum in $\Theta(n)$ time too. 

So the problem admits a $\Theta(n)$ solution, but what you have been offered isn't it.