- Review lecture notes covering Big-Oh of polynomials, non-polynomials, limits
- Work through the tutorial problems for week 10 again.
- Work through some of the extra practice problems linked on the course homepage.
- Post questions that further confuse me on Piazza.
Thursday, 20 November 2014
More Big Oh
Its time to get a bit more complicated with Big Oh. In other words, lets actually try to apply the working definition of Big-Oh to proofs. As a reminder here is the formal definition of Big-Oh as introduced in class. That is,
Tuesday, 11 November 2014
Complexity and Algorithm Analysis
The past weeks we dived into algorithm complexity introducing an array of new concepts including: Big O, counting steps and worst case. I will begin our discussion at Big O. Typically Big O is used to compare how two algorithms scale up as the number of inputs increase. For example, consider the following cases:
- O(n) ---> If the size of the input n increases, the runtime will increase linearly.
- O(log n) ---> If the size of the input n increases, the runtime will increase logarithmically.
- O(1) ---> If the size of the input n increases, the runtime will remain constant (no change).
There are many other cases to consider, which we won't go into here. If interested please check out the following link: \http://bigocheatsheet.com.
We also extended Big Oh to determine the complexity of the worst case runtime of the sorting algorithms we considered the previous week. For instance, in the worst case bubble sort has a complexity of O(n**2), merge sort a complexity of O(n*log n), and insertion sort a complexity of O(n**2). Fortunately for me, I found this content to be a review of the material presented in CSC108.
Subscribe to:
Posts (Atom)