2015年4月5日星期日

Week 12

Yeah~ Here comes the last week.
This week, we talked something about Big-Oh. It kinda reminds me of CSC165, but I think it studied further than what we learnt this week. I remember we discussed a lot for almost 3 weeks in CSC165 last semester. Big-Oh is like an index of complexity of the function. How many times the loop would be reached and how many lines overall would be reached. If there is one loop in a function and the parameter is all about n or kn(where k is a constant), then this function is in O(n). If there are two loops in a function and there is a loop inside the other, and the parameter of loop are all about n or kn, then it is in O(n**2). If there is a loop in a function and it is about n**2, then it is in O(n**2) as well. Overall, it is like a relationship between the power of parameter, the deepness of loops and how much time it needs to compute the function, and how quickly the time is increasing. What I did not know at CSC165 is O(lgn) is slower than O(n) and it doesn't matter whether the base is 10 or 2 because the difference between them is just constant.
I feel learning a lot in this semester. Finally, I would like to say 'Thank you' to Danny Heap and Diane Horton for what they've done in this semester! Good luck on final exams, my friend.

没有评论:

发表评论