October 20th, 2012, 10:57 AM
[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
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!