Posted in Uncategorized

4 Semesters of Computer Science in 6 hrs – Big O

I’m working through a 6-hour-long video series which covers such topics as Big O notation, algorithms, data structures, etc. : Basically, the nitty-gritty stuff that we didn’t cover in DBC.

First, a very simplified was to determine Big O –

n : If you have a single loop, your function is O(n).

n-squared : If you have nested loops, each additional loop adds one to the exponent. So, a loop in a loop would be n-squared; a loop, in a loop, in a loop, would be n-cubed, etc. These are bad news.

1 : If you have no loops at all; you go in, perform an operation, and get out, your big O is O(1).

log(n) : If you’re using any kind of recursion – or divide and conquer – your big 0 is O(log n)

On to the next lesson!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s