2014年3月30日星期日

SLOG: recursion

Recursion recently becomes our new topic after the learning of basic idea of OOP. It can be briefly described as a progress that function repeatedly runs itself until it reaches some sorts of conditions or goals, otherwise, it would keep looping. It is somehow similar to the ideal of using ‘while loop’, but in this case, it put the function itself back into the code, which increases a lot of challenges and deficiencies.  Binary tree would be a great example to show the use of recursion. Since it needs a majority of times of looping to get answer, recursion becomes amazingly suitable to binary tree search. I remembered the time when teacher show how the recursion works and use it to draw out the picture, and it was shocked and amazing.


An achievement that we got in this week was that we finished the assignment one, the one that needed to automatically find the running times of Tower of Haoni. But instead, we used cheese this time. To be frank, it is so difficult to use recursion cause it required a lot of thinking while using it, even though it needs only single-one line code in a function. Those people who did not learn computer science before would feel unconfident to use recursion.

SLOG: Sorting and Efficiency

Sorting and Efficiency

During these weeks, sorting becomes one of the most significant parts that we focus on after learning the recursion. It is basically an idea that rearranges the elements which are disorder and unorganized in a sequence back into some sorts of orders by repeatedly organizing, for instance, a sequence with 2, 1, 3, 5, 4, can be rearranged to the order that is from the smallest elements to the biggest elements, which is 1, 2, 3, 4, 5.  By using the methods of sorting, it would be contribute to saving times, for we can follow the order we want to design a program.  This makes me remember the idea of bubble sort that our CSC108 teacher taught us.

There are many sorting methods that have been developed for sorting the sequences back in order. During the class times, we have learned three types of different ways relating to sorting, which are the selection sorting, the quick sorting and mega sorting. No matter how it varies its ‘name’, the significant parts is the efficiency, to use the least times to do the most works, this leads us to a part that we needs to distinguish the worst, average, and best cases of those sorting methods, and I believe this is the most challenged parts that barriers me.  To give an example, selection sorting uses a recursive algorithm. In average case, it needs to take ‘nlog(n)’ times to finish the works if the list is set up by randomly, however, if the list has already a sorted list, then, it needs to take twice the times to finish to work. To be frank, it is a tough part when I was learning in class.

Also, the lab goes much more challenging than the past, I remembered that there is a lab handout that my classmates and I spent the entire class period to solve, but instead, we met a tough barrier in the first question that needed us to arrange them in ‘inorder’ and could not get any meaningful progress. That was a frustration. But I believe this is the meaning of the lab that required us to put hundred percent attentions towards the questions and figure them out in order to improve our skills.

2014年1月23日星期四

SLOG

There are several things that I learned in class, among those new materials, undoubtedly, the ideas of OOP, which the Object-Oriented Programming, have extended my field of vision towards the computer sciences. To be specific, it offers an idea that programs can be separated into several of “Class” in which these “Class” have the definitions of all the properties of one material. These “Class” would be considered as models, a structure that saves information. So comparing with the traditional idea that designs a ton of codes and functions to run a program, OOP gives me a totally fresh idea. 

Also, the use of Point, which looks for the coordinates of x and y and uses class to identify its meaning, provides me the most intense feeling. It is a true fact that nothing is enjoyable during the class period, however, the examples of python cases and the explaining articles from the website named ‘OpenBookProject’, and they do help a lot in figuring out some challenging parts. It feels comfortable to use these resources to solve problems, although some reading materials are ambiguous and complicate. 

This course is having a close relationship with CSC108 that computer sciences class I taken in last section, which is a study that learns about the use of code. To be frank, I haven’t taken any lessons relating to computer sciences before, and this would be a big challenge that needs to overcome. There is a lab tutorial once a week with a TA that leads us to finish the tasks which were given by the teachers, and it is beneficial for developing our skills. I remember the challenge task that required us to compare the efficiency between functions ‘Queue’ and ‘Stack’ and to offer a solution. It is like a brainstorm, and it focuses each one of our group members to concentrate in it, which makes us have a better understanding of the principle of running codes.