Why is the time-complexity of
function (n)
{
//this loop executes n times
for( i = 1 ; i <= n ; i + + )
//this loop executes j times with j increase by the rate of i
for( j = 1 ; j <= n ; j+ = i )
print( “*” ) ;
}
Its running time is n*(n^1/2)=n^3/2
so, O(n^3/2)
Please explain with mathematical steps.
Thank you in advance.