Saturday, April 4, 2015

It is time to say GOODBYE...

This is my last slog for CSC148. HOW TIME FLIES!!!
Can't believe we are at the end of this course (with exam to come!), and this is going to be my last impression of this course :((
If you remember, I summarized my understanding of linked list in this post, and decided to do a comparison between linked list and normal list, which I haven't done so. I am going to do it here and also combine it with the last lecture we had about efficiency and bigO notation.
The comparison between a linkedlist and a noraml list is based on my knowledge about java, so please correct me if I state anything wrong.
As far as I know, a lot of people are wondering about why do we need a linked list data structure if we already have our normal list which perform exactly the same sort of tasks. Well, the truth is, depends on the task that you want to perform, sometimes it is more efficient to use a linked list, while sometimes a normal list may be better. To see why, let's first visualize how these two data structure look like.

Sorry that the picture says array cause  I took it from a java website. Basically, array is the same as a list in python.







1. Access an element.
For a list, we access each element through indices. However, for a linked list, we have to walk through the list via references. In the worse case scenario, the run time efficiency for a linked list is O(n), while for a normal list is O(1).

2. Adding/Deleting elements
Linked list allows us to add or delete element much easier than lists (I discussed how to insert an element in linked list in a previous post here) In a list, we would have to shift every element to make room/fill up space for the operation of adding or deleting. If the list is small, this is no problem, but if we have a really big list, this may take a really long time. Yet, in a linked list, the only thing we need to do is to create a new node and change one or two references to add that node or delete it from the linked list. In fact, performing operations like adding or deleting on a normal list has run time efficiency O(n), while on a linked list has run time efficiency O(1).
In sum, if we need to perform a lot of accessing operations and seldom insertion or deletion, then using a normal list is more efficient. On the other hand, if we need to perform a lot of insertion and deletion but seldom accessing operations, then a linked list is a better choice.

A last note about CSC148...
At last, I want to say that it has been a great pleasure to be in prof Danny's class. He is one of the best professors I have encountered in my first year at UFT. I really like studying CSC148 because I find that students in this course are really supportive to each other, whether it is through piazza or just answering questions in class. A big THANK YOU to my assignment group! I really enjoy discussing all those mind blowing recursions problems with you guys. There were times when we were  stuck and frustrated, but we shared our ideas, pose questions, support each other and finally we managed to finish everything! You guys are the best teammates I have ever had, and we have come across so many things that I am sure our friendships will last even if this course has come to an end.

I appreciate all the help from my fellow classmates, teammates, Tas as well as the professors. It is been a great semester studying with all these wonderful people. It is hard to say goodbye... but the farewell time has come, so...
 GOOD LUCK ON YOUR EXAMS EVERYONE!!! and I hope you all have a wonderful summer!!!