For n=1 : Inner loop will execute 1 time.
For n=2 : Inner loop will execute 1+2 times.
For n=4 : Inner loop will execute 1+2+4 times.
For n=8 : Inner loop will execute 1+2+4+8 times.
. . .
那么我怎样才能找到计算复杂度呢?
我的答案是:内循环迭代次数 = n+(n/2)+(n/4)+(n/8)+...+(n/n)