Participate in Codex, Test Your Skills & Win BIG

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

Discussion


Loading...
Click here to start solving coding interview questions