401 Class One Reading Notes “Names and Values in Python”
Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.
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.
O(N²) represents an algorithm whose performance is directly proportional to the square of the size of the input data set. This is common with algorithms that involve nested iterations over the data set. Deeper nested iterations will result in O(N³), O(N⁴) etc.
O(2^N) denotes an algorithm whose growth doubles with each addition to the input data set. The growth curve of an O(2^N) function is exponential — starting off very shallow, then rising meteorically.
Questions
- What’s your perspective? My perspective is this is very demanding work and I hope I am able to keep up with it.
- Why are you doing this? I am doing this in part because it was free to me and in part because I wanted to expand my knowledge base in tech and find a new job.
- Do you want what comes at the end of this journey? Yes
- Are you doing this for you? Yes
Things I Want to Know More About
- I didn’t really grasp the Big O content very well from the readings. I understand the label system but have no idea from this when I would be using them in code.
Resources
- Pain and Suffering
- Beginners Guide to Big O
- Season 1, Episode 6, A friendly intro to Big O Notation -Video: Names and Values in Python