Aside from reviewing my thoughts on sorts, I would also like to write down my thoughts and impressions of this course. CSC148 was overall an interesting yet challenging course. Recursion, linked list, binary tree, etc., none of the above topics were easy for me, and I often find myself struggling in class and during labs. Fortunately, I had a group of helpful labmates (and TA) who got me through this semester. This course also took me through the ups and downs; I did extremely well on the first midterm and extremely bad on the second one. This is actually a good opportunity to learn and adapt different feelings, and instead of getting stuck with depression and other sadness, I have to overcome it and move on. The exam is coming soon, and to be honest, I'm confident at all, but I will try my best to get myself prepared.
As I mentioned above, this course contains many conceptual and difficult topics l. I personally found recursion the most difficult. Even by learning one step at a time with patient, I still found this particular concept hard, especially writing and implementing the recursive code. I discovered several solutions to help myself with. One way was to visualize the implementation of the code. For instance, I draw diagrams for the use of recursive code in binary tree. I believe what I learned in CSC148 is important as they are the basis of computer programming and I hope these foundational contents will assist and inspire in the future.Enoch's World with 148
Wednesday, March 30, 2016
Week 11 Slog: Last Impressions and Sorts
In the last couple of weeks, we learned between different algorithms result in different efficiency. A good algorithm can provide extremely high efficiency while a bad one cannot. As a computer science student, it is important to understand algorithms and learn how to evaluate the efficiency of functions. Throughout this course, we learned several sorting algorithms, including bubble, insertion, selection, merge, quick. They are using different methods of sorting and therefore having efficiency are different. However, I find that we shouldn't choose algorithms only base on their efficiency on the worst case, since sometimes our function would be used in some kind of specific data, and that might be not in worst case. Consequently, when we are choosing algorithms, we should consider both the efficiency of the algorithms and the condition of our target data or what our function to be used for.
Wednesday, March 9, 2016
Week 8
This week, we learned about Binary trees and Binary Search trees, a way of organizing data in trees such that they are easier and more efficient to search through. In class last week, we wrote a function called insert that inserted data starting at node, and returned the root. We examined the code (def insert) and talked about a new function for deleting data instead of inserting data. In the function for inserting data, we wrote a recursive function. Taking in a node and data, the function should insert the data at the node and return the root. Starting by assigning the node to a new variable, called return_node, we then wrote an if statement for the simplest example, where there is no node (if not node:), if that is the case, then the variable return_node should be assigned the new data. If the new data is less than the data at the node, then the data is inserted in the left node, else if it is greater than the data at node, then it is inserted to the right. This is a property of binary search trees (greater values are on the right and smaller values on the left of the node). Finally if there is nothing else to do, (else statement), return_node should be returned. This code is easy to understand, especially after breaking it down like I did above. By going through the code line by line and "reading" the if's, elif's and else statements, you can understand what the code does, even if there is no docstring description.
Wednesday, February 24, 2016
Week 7
The main programming languages we study in CSC148 is Object-oriented programming. Object-oriented programming is a programming paradigm that makes the functionality and data together into an object, and python is an object-oriented programming languages. The objet-oritented programming in python consists of two parts: classes and methods.The class is a user-defined in the class. The class has an __init__(initialize) method which is used to set up attributes and new instances. I think Object-oriented programming provides a very clear modular structure, and easy to modify when there is only a slight change to the existing code. Overall, it is clear structured and intelligible.
I consider recursion as the hardest topic I have encountered in this course so far. To use recursion, we should divide the problem into some sub problems, and solving the problems by calling the sub problems. The recursion really makes some complex questions easier, and its really hard to come up with the idea in the first place. The recursion requires a case outside it to make itself finite.
I consider recursion as the hardest topic I have encountered in this course so far. To use recursion, we should divide the problem into some sub problems, and solving the problems by calling the sub problems. The recursion really makes some complex questions easier, and its really hard to come up with the idea in the first place. The recursion requires a case outside it to make itself finite.
Week 6
This week, we focused heavily on the use and effectiveness on recursion. I certainly have heard of this technique in solving problems before but never really wrapped my head around it until now (although I would say that I am still pretty bad at it). Recursion is definitely very powerful technique if used correctly at the right situations but honestly, simple iterations should be used whenever possible (not over thinking a problem). I was realizing this because as we learned in the first few weeks of class, every single time a method is called, it is put onto a stack and as a result, takes up more memory. In the case of constant recursive calls, it makes a lot of sense that it would create an immense amount of overhead to execute its codes. It would be sensible to avoid recursion as much as possible.
Wednesday, February 10, 2016
Week 5
We focused on a data structure called linked list this week. It is very queue to a stack except each object inside the data structure holds the reference to the next object. However, it is comparatively much more superior to a queue in terms of efficiency because insertion of new elements mean only having to deal one reference (as opposed to moving items back and forth in a queue). The lab was very challenging this week because we had to literally code to find the length of the linked list and how to insert a new element to a desired position without raising any errors. I realized I over think many parts of the code and it definitely consumed a lot of time (tried to use recursion every where I could). Sometimes, it is better to think from a more simpler perspective and it could turn out to be a lot more.
Wednesday, January 27, 2016
CSC148 Week 3 SLOG
It has been nearly three weeks since the kick-off of winter semester. Within this short period of time, I already attended and completed several lectures, tutorials and assignments. As expected, this course seems to be a continuation of CSC108, an introductory course of computer programming. The material covered in class are interesting yet challenging; it motivates me to explore the world of programming. The first tutorial was quite a memorable experience for me. It was my first time working in Bahen centre's computer lab, my first time swiping the t-card at the door, and also my first time working with a stranger whom we become friends later. These tutorials/labs provide great opportunities to interact with other students who share a similar interest and passion. I am definitely looking forward to learn, discover, and be inspired in CSC148.
Subscribe to:
Posts (Atom)