۰
subtitle
ارسال: #۱
یک سوال ازپیچیدگی زمانی ( T(n
What is the time complexity T(n) of the nested loops below? For simplicity, you may assume that n is a power of 2. That is, n = 2k for some positive integer k.
کد:
[align=left] i = n;
while (i >= 1){
j = i;
while (j <= n){
< body of the while loop> //Needs Θ (۱).
j = 2 * j;
}
i =[i/2];
}
[/align]