This week's designated topic was to revisit one of my posts and discuss whether my reviews or opinions had changed. I would like to head back into last week's entry regarding assignment 2, term test 2, and efficiency and run time. However, I'd like to focus on the last topic that I wanted to avoid -- Efficiency and Run Time. In even earlier entries (read: Entry 2: Week 4), I had already admitted to disliking this topic because I am not good at it. This creates a pessimistic loop as I avoid it more because I hate it, and the more I avoid the topic the more I hate it. The main problem here is, I think, my lack of proper understanding. Although taking CSC165 helps with learning the concepts at the same time, there are still some discrepancies between the two courses -- after all, one is more math based and the other more code based. With regards to how my opinions had changed...?
Firstly, after going back and reviewing CSC148 and CSC165 slides, I now have a clearer mindset when I look at the code. Usually what messes me up are loops that have increments of a random amount. While eventually the counting should be math based, Professor Danny Heap's slower method of actually listing out examples of the values the counter can become definitely helps with visualizing. Also, listing out smaller countable examples also can help me find the general pattern to the run time function. He also gave out three basic rules regarding the different forms of code;
- Sequences: Find the max(O(f(n))) of each statement as O(f(n))
- Lists: (Carefully) Count loop iterations, multiply for each nested loops
- Conditions: Take max(O(f(n))) which comes out of the worst case scenario
From the examples and counting, I can then summarize a pattern to compute Big-Oh for the function. Rather than panicking, I should sit down and comb through the code and work through the knots that are confusing me (ie Incrementations).
I am also very happy that in this course no specific O(f(n)) is required down to every line of the code. Working with patterns and putting them into summations to see the general trend may be one thing, but working out and expanding the summations is something completely different and definitely more difficult. After trying out a few examples the class had looked over together, I feel more reassured at my ability to judge Run Time and Big-Oh. Thanks to this course, I now have a better understanding and am more confident in working with them. Although I still feel slightly bothered because I don't know them like the back of my hand, but I am working towards getting better at them one step at a time.
One last trouble I still fret over regarding Run Time and Efficiency is the kind of problem where a chart of run time is given and the requirement is to find the O(f(n)) it belongs to. Even after comparing them to the patterns -- log(n), n, nlog(n), n^2, etc... I remain unsure because some of the patterns are still similar, especially with relatively smaller "n". If the difference in "n" is small between the given examples, the difference in T(n) is also not as significant or telling as it can be with bigger differences in "n". For example, the difference between the run time of O(nlog(n)) and O(n^2) for n = 100 to n = 200 is not as obvious as the difference between the two for n = 100 and n = 10000. This is still something that I've got to work on.

