Analyze the efficiency of the algorithm used in the code. Use O-notation. class Solution { public
Fantastic news! We've Found the answer you've been seeking!
Question:
Analyze the efficiency of the algorithm used in the code. Use O-notation.
class Solution
{ public int[] countBits(int n)
{ int[] out = new int[n + 1];
for (int i = 0; i <= n; i++) {
out[i] = out[i / 2] + i % 2;
} return out;
}
}
Related Book For
Posted Date: