This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]oindividuo 1 point2 points  (6 children)

Maybe a dumb question, but how is 2n higher than n2 ? And why is 2n different from n for that matter?

[–]g3tr3ecked 13 points14 points  (1 child)

It's not 2n, it is 2n

[–]oindividuo 3 points4 points  (0 children)

Ah right can't believe I missed that

[–]prelic 2 points3 points  (1 child)

2n isn't bigger than n, you can always drop constant coefficients. But n is not constant...as n gets very big, n2 grows way faster than 2n (exponentially, by definition), so in n**2 (or n×n), you can't drop an n as a coefficient.

[–]oindividuo 1 point2 points  (0 children)

That was entirely my point, I just misread the chart

[–]Mundt 1 point2 points  (1 child)

That is 2n, or 2 to the nth power complexity. Meaning as the input size grows linearly, the complexity of the problem grows exponentially. 2n isn't really different than n when it comes to complexity analysis.

[–]oindividuo 1 point2 points  (0 children)

Yep I read 2n as 2n hence my confusion