WHILE_CMPL

What is the time complexity of the following code :

        int a = 0, i = N;
        while (i > 0) {
            a += i;
            i /= 2;
        }
Sign Up
to access hints and editorial solutions for WHILE_CMPL
Click here to start solving coding interview questions