Tuesday, 17 September 2013

Time complexity for c*c?

Time complexity for c*c?

Got time complexity questions here:
for i = 1 to n
if something
p = p*c
c = c*c
For line 1, the time complexity should be n, but what about line 3 and 4?
is that n^2? or n^n?

No comments:

Post a Comment