Some practice for all of us. Follow the images for answers.
Refresh your Big-O knowledge here: http://www.vingle.net/posts/509676-O-Notation
Source: http://www.sitepoint.com/time-complexity-algorithms/

Programming Trivia: What Complexity of this algorithm?

Some practice for all of us. Follow the images for answers.
Refresh your Big-O knowledge here: http://www.vingle.net/posts/509676-O-Notation
Source: http://www.sitepoint.com/time-complexity-algorithms/

2 comments

TechAtHeart

Would it be n^2 + n?

csgeek

@TechAtHeart, you are technically right, though you should simplify and keep it at O(n^2)