Given,
T(n)=Ī£i=1i=nāĪ£j=1nā1ā(1)
We know that,
Ī£j=1nā1ā(1)=(nā1)
So complexity of this step will be O(n)
Now again,
Ī£i=1i=nā(nā1)
=Ī£i=1i=nā(n)āĪ£i=1i=nā(1)
=2n(nā1)āān
=2n2āā2nāān
=2n2āā23nā
So the complexity of the steps will be as per the below-
=21āO(n2)ā23āO(n)
Hence the required final complexity will be =O(n2)