Re: Filling 2d array in less than O(n^2)?



With all respect, but not obvious for me.
I think it comes down to the fact that pjhyett is using the length of one side of the array as 'n' instead of the number of elements.

Using the length of one side its O(n^2) , using the number of elements its O(n).
.