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-
=21O(n2)−23O(n)
Hence the required final complexity will be =O(n2)
Comments
Thank you so much it's help me alot