-
October 20th, 2012, 10:57 AM
#1
[RESOLVED] Big-Oh Notation Question
Ive been trying to figure out what the big-O notation is for this code segment:
for (int count =1; count < n; count++)
{
int count2 = 1;
while (count2 < count)
{
count2 = count2 * 2;
}
}
My friend has been telling me its O(N^2) but I dont know if that is correct and if it is correct, I have no clue how they found that answer.
Anyone have any ideas???
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|