int Fun (int n)

{

  int temp;

  temp = 0;

for (int i = 1; i <= n; i= i*2 )

     for (int j = 0; j < i; j++)

        temp += 1;

  return temp;

}

What is the time complexity of the above function?

1

O (n2)

2

O (n log n)

3

O (n)

4

None of these

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation