I have a simple algorithm that prints the two dimensional matrix (m*n, m and n are different numbers):
for(i=0;i<m;i++)
for(j=0;j<n;j++)
Console.WriteLine("{0}",A[i,j]);
I read that the big O notation for this algorithm is O(n^2); Could somebody explain me what is the "n^2" in that statement? If this is number of elementary operations, then it should be m*n, not n^2?