InterviewBit Academy is now Scaler!
Learn Tech Skills from Scratch @ Scaler EDGE

WHILE_CMPL

What is the time complexity of the following code :

        int a = 0, i = N;
        while (i > 0) {
            a += i;
            i /= 2;
        }
Hints
  • Solution Approach
  • Complete Solution

Discussion


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