Complexity Analysis

What is the Complexity of the following Code:

for(int i=2;  i<N;  i=i*i)

{

count++;

}

Hint: it is not lg(N) 🙂

Advertisements

2 comments

  1. I guess lg(lg(N))

    1. Well, it took a long time to get an answer from someone to this question.
      Indeed, you are rite, it is lg(lg(N)). You remember, the test for Systems software house? This question was in that test and we all did it wrong!! But, at last, we know it!! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: