Wednesday 2 April 2014

La Fin



I cannot believe I finished this course already, it's unbelievable how fast it went by! That's probably due to the fact that I really enjoyed 148 and I can honestly say that over the course of my first year, I learned the most in this class. Professor Heap is amazing, TA's were extremely helpful and to the point, course material was sooooo interesting, labs were extremely fun and challenging, assignments were my favourite, … So I'm glad to say that 148 has been my favourite class this year and I'm eager, excited and looking forward to what the Computer Science program has in store for me next year!

Sorting


Sorting was the main topic for the week. We discussed Big-Oh runtimes of several sorting algorithms such as insertion sort, selection sort, etc., you know the rest! This was nothing new as I had already learned this in CSC108 and CSC165. But what was in fact new to me is merge and quick sort. Merge sort is the only sorting algorithm that I understand properly and that makes the most sense. So the concept consists of taking a list, splitting it in half (because of base 2, which requires in any runtime case log(n) steps) and then iterating over each element in order to sort (which requires in any case n steps). From this, we understand where the log(n) x n is derived from; since merge sort splits in half then iterates over the halves, we multiply n times log(n) due to the nested loop. The hardest part of this week would have been understanding these sorting algorithms by analyzing their codes. I think it was due to the fact that when I was first introduced to insertion, selection and bubble sort, their codes weren't written in simply one or two lines so it was easier to deduce where the runtime equations came from. 

Friday 21 February 2014

ReEcCcuUuurrRrrsssSsssiiiiIiiiooooOoooonnnnNnnnnn......

Throughout the term, we've gotten very familiar with recursion. We made use of it for Tour of Hanoï, binary trees, nested lists, etc. For simplicity's sake, a recursive function is simply a function that calls itself within its function definition. Recursive functions are useful when we have to work with nested objects. This concept of "calling the function within itself" is so fascinating because it allows us to solve problems on nested objects by writing code for the main problem and having the recursion work its magic by solving this same problem for all the nested objects on the smaller scale. Once I grasped this idea, with some tracing and practice, I began to seriously understand recursion, not only technically (writing code and all) but visually, the problems became so much easier to picture in my mind. With that, the labs are extremely helpful as usual and I'm looking forward to implementing more recursion in the course!

Saturday 15 February 2014

Cheeses and Trees

We started off the week learning about binary trees. Roots, nodes, edges, leafs were some of the terms we associate to them. It was also the last week we had to finalize our assignment. I must say the most difficult part had to be Step 5, where we had to come up with a function to minimize the number of moves by choosing the appropriate i, which varied from one amount of cheese to another. I'm glad I was able to work with a partner because it really made all the difference. The thinking process is minimized when you have another person to bounce off ideas from! It was such a relief when we tested the console and everything worked out smoothly. Week 6 was definitely a challenging but successful week!

Thursday 13 February 2014

SlogTrois

I can't lie, at first glance, I thought Assignment one was going to be very difficult! Interesting, but difficult. In my case, understanding the initial Tour of Hanoi problem, the story behind it, was where I found complication. Only when the instructor began giving an overview and helping us understand the thought process behind the problem did I realize that this assignment was probably going to be one of the most interesting/fun/challenging assignment yet! Teaming up definitely facilitates things by helping me overcome small problems that I might complicate. All in all, my partner and I made great progress during this week because we were committed to completing this task prior to the due date #shorttermgoals!

SlogDeux

This week had a huge focus on recursion which was very much needed for me! The professor used the Turtle class in Python to help us visualize the concept. I was able to make a link to fractals in physics, which are basically a recursive image where zooming in on one part of the image is identical to the initial one, just on a smaller scale. Ever since then I've been able to understand how to properly implement recursive functions so my lab was a breeze! The most difficult part is handling these recursive problems at first sight, so tracing really makes all the difference.

Wednesday 22 January 2014

SlogUno



So far, these past few weeks have been a great review of the CSC108 material. But they did not only consist of a review, there are a couple of new concepts that I was familiar with prior to taking this course but did not know exactly how make use of. For instance, recursion and exceptions!

Personally, going into CSC148 at the beginning of this term, I was not very comfortable with classes. I was just not able to understand the idea behind some key concepts. I'm glad to say that I have overcome this weakness of mine all thanks to the first two labs. In terms of OOP, inheritance is something that's all new to me. The idea is quite remarkable; is it time efficient, easy to implement changes and maintain code. Recursion was something I had a prior idea about from my CSC165 course but never quite understand the actual process, since we were just analysing the algorithm. So the sum_list(x) example we saw in class definitely clarified the main concept.

Finally, I really benefit from the professor's constant interaction with the students! The entire structure of the lecture is very dynamic and allows everyone to understand and learn several techniques and points of views. I can honestly say I'm looking forward to attending class every week with the few extremely remarkable things we've already covered in such a short period of time.