Code Fellows 401
Day 01 Notes
Home
Reading
Pain and Suffering
Beginners Guide to Big O
Additional Resources
Season 1, Episode 6, A friendly intro to Big O Notation
Videos
Names and Values in Python
Bookmark and Review
Awesome Python Environment
Things I want to know more about
- Big O notation is a way to describe the performance of an algorithm in terms of how the number of inputs (n) affects the number of operations it performs.
- It is used to describe the upper bound of an algorithm’s running time.
- The most common complexity classes are O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n) and O(n!).
- O(1) represents a constant time algorithm, which performs the same number of operations regardless of the input size.
- O(log n) represents a logarithmic time algorithm, which performs a number of operations proportional to the logarithm of the input size.
- O(n) represents a linear time algorithm, which performs a number of operations proportional to the input size.
- O(n log n) represents a log-linear time algorithm, which performs a number of operations proportional to the input size multiplied by the logarithm of the input size.
- O(n^2) represents a quadratic time algorithm, which performs a number of operations proportional to the input size squared.
- O(2^n) represents an exponential time algorithm, which performs a number of operations proportional to 2 raised to the power of the input size.
- O(n!) represents a factorial time algorithm, which performs a number of operations proportional to the factorial of the input size.