Reading 01 - corey-marchand/401-python-data-structures GitHub Wiki

Pain vs Suffering

  • We will be pushed mentally, having to think through problems

  • Will lose sleep

  • Constantly be put outside your comfort zone

  • Will have to figure out how to collaborate with new people

  • This class is very hard and is not easy. Be prepared and keep trooping on for more success.

A beginner's guide to Big O notation

  • O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set.

  • O(N) describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set. The example below also demonstrates how Big O favours the worst-case performance scenario; a matching string could be found during any iteration of the for loop and the function would return early, but Big O notation will always assume the upper limit where the algorithm will perform the maximum number of iterations.

  • O(2N) denotes an algorithm whose growth doubles with each additon to the input data set. The growth curve of an O(2N) function is exponential - starting off very shallow, then rising meteorically. An example of an O(2N) function is the recursive calculation of Fibonacci numbers: