NESTED_CMPL3

What is time complexity of following code :

        int count = 0;
        for (int i = N; i > 0; i /= 2) {
            for (int j = 0; j < i; j++) {
                count += 1;
            }
        }
Hints
  • Complete Solution
26640 successful submissions.
Click here to jump start your coding interview preparation