-1
我有以下伪代码,我想确定它的运行时间T(n)。 有人可以给我我应该遵循的步骤吗? 下面是代码:确定伪代码的运行时间
i := 1;
while (i <= n)
j := i;
x := x+A[i];
while (j > 0)
y := x/(2*j);
j = j /2; // Assume here that this returns the floor of the quotient
i = 2 * i;
return y;
@saydak更新了计算 –