1.

Consider the following segment of C codeint j, n;j = 1;while (j <= n) j=j*2;The number of comparisons made in the execution of the loop for any n > 0 is

A. \(\left\lfloor {{{\log }_2}\,\,n} \right\rfloor \times n\)
B. \(n\)
C. \(\lfloor \log_2 n \rfloor\)
D. \(\lfloor \log_2 n \rfloor + 1\)
Answer» E.


Discussion

No Comment Found