This week is the last week of school, as much as I feel relieved, the pressure of final exam is quickly approaching.
In week 11, we learned about Big-Oh. This concept was difficult for me because while my peer studied this in CSC165, I took CSC165 in UofT Scarbough and we never discussed this topic. From my understanding of the lecture and the additional readings I did, I feel that Big-Oh is basically the upper bound of the running time of a function. For instance Big-Oh(x^2) means an upper bound, and any function that runs faster than quadratic is not in Big-Oh(x^2). Same logic follows for Big-Oh(x^3) and higher.
I believe the fundamental Idea of Big-Oh is to test how fast a program runs, and whether the running speed can be optimized. A quadratic function that solves a problem is obviously better than a cubic function. The use of Big-Oh to measure running time can therefore determine if a function is well-written and efficient or not.
In this lecture we also briefly touched upon ways to count running time of different functions, and see if they are in Big-Oh. We however, did not discuss this in detail. The professor gave a few examples to count, but I did not quite get that. I remember one way I learned is that the running time of a for-loop can be determined by multiplying the Big-Oh of the inner loop( linear, quadratic or cubic) by the Big-Oh of the outer loop.
I think this new concept will not be too challenging, because many of my friends have studied it and I can go to them for help. Furthermore, I also think recursions and classes are more complicated and calculation-oriented than this. However, I recognize that this concept is extremely useful, as the ultimate goal of a programmer is to write code that are both correct and efficient.