DEV Community

Discussion on: Big-O Notation: Beginners Guide

Collapse
 
josephgalindo profile image
Joseph Galindo

Good post :)

Would the exponential example not be 100, 200, (...400), 800 though?

Collapse
 
metcoder profile image
Carlos Fuentes

Yes, sure!

Sorry, my bad. I'll fix it, thanks! ;)

Collapse
 
josephgalindo profile image
Joseph Galindo • Edited

No problem...did want to post back though since I saw the article was updated.

In the example you laid out, I think an algorithm running in O(2^n) time would be more like this:
10 items - 100s
11 items - 200s
(12 items - not listed - 400s)
13 items - 800s

Just wanted to point it out, since the typo makes the algorithm sound more performant than it really is.