Consider the following segment of C code

int 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

1
\(⌊log_2 n⌋^* n\)
2
\(n\)
3
\(⌊log_2 n⌋\)
4
\(⌊log_2 n⌋+1\)

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation