Friday, 28 February 2014

Recursion

One of the new things that has been taught to us this semester is Recursion. The definition of the word "Recursion" is "the process of repeating items in a self similar way". In Computer Science, recursion mean "to define something within itself. A recursive function would be a function that calls itself in it's definition. This is somewhat similar to an iterative function definition that has a loop. Recursion is a powerful tool because functions can call themselves multiple times in order to achieve their objective or goal. However, in order for the recursive function to know when to stop calling itself, it must have a base case. Base Case is defined as "A branch of the conditional statement in a recursive function that does not give rise to further recursive calls." Without the base case, the recursive function will not stop calling itself and will eventually result in a recursion depth exceeded error. Base case could be somewhat compared to the condition in a while loop, because the base case will stop the recursive calls once its conditions are met, just like a while loop will stop when the condition of the while statement is fulfilled. Therefore, base cases are always included in the conditional structure of a Recursive Functions. Also included in the conditional structure of a recursive function is a general case. A general case specifies how to combine recursive subcalls.
After studying recursion for a couple of weeks now, I understand why it is a very useful and powerful tool to use in Computer Science. However, I am personally having a difficult time applying the idea or concept of it into my own coding. For example, If I see a problem where I believe recursion could be used, I sometimes don't know how to code the recursive function correctly, especially for more complex problems. Also, I also have found that tracing a recursive function to be a really big challenge. I remember at the beginning of CSC108, my professor said that Computer Science is one of the courses where the time it takes people to understand and be able to solve problems varies wildly, where in some cases a problem could take one person a short amount of time to solve, and another person a very long time to solve. I think I am one of those people that take a longer time to apply the concepts we have learned to programming. I believe it will come in time and through practice.
In conclusion, I personally believe Recursion is an important aspect to learn in Computer Science since it could be used in so many ways to solve small problems and big problems. Additionally, if coded right, it will save a programmer a lot of duplicate code, which contributes to the idea of "laziness" in Computer Science. I think I have made progress since first learning Recursion since I now understand its concept and purpose a lot more than I did before, now its just a matter of being able to apply it when I have to solve problems on my own.

Thursday, 20 February 2014

CSC148 Week 6

Week 6 of CSC148 lectures was an interesting week for me. Week 6 introduced a new concept--at least to me--about how to think like a computer scientists, using the concept of a tree as an analogy to computer scientists. On the surface, this new concept to me seemed simple to understand, especially during lectures when Professor was going over it. However, upon doing the readings on it myself, I found that it was a little bit more complicated than I initially imagined. The analogy of the tree does make sense to me but applying it to code is a little bit confusing. A lot of times in this course, I have found that I have a hard time applying my understanding of concepts that I have learned in class to my own approach in programming. For example, while working on assignment 1, I somewhat understood what I had to do but I couldn't write it in code and needed my partner's help. I think that all of this is a learning experience for me and I hope I can use the reading week as a time to grasp and understand the course material better. As I prepare myself for the CSC148 midterm, I plan to review the labs that we have done and re-read the readings. I hope that by the time the test comes around that I will be prepared for it. For me, the biggest challenge is to be able to take my understandings of each specific problem and apply it into written code. In conclusion, week 6 was a useful week and I hope that by the time we return from reading week that I will have a much deeper understanding of the course material so far. The reading week will definitely be able to help me with that.

Monday, 10 February 2014

Week 5 CSC148 Blog

This week in lectures, we continued to learn more about recursion. We also focused on getting recursive insight. I feel that this week, I am beginning to understand recursion even more than I have before. I feel that this is important because recursion from my understanding is a very important aspect of Computer Science. As an aspiring Computer Science major, I believe it is important to really grasp this concept and be able to apply it in the right circumstances, not only for the upcoming assignments and tests, but also for other Computer Science courses in the future. The lectures and lab this week also focused again on tracing recursion. I found the lab to be helpful in developing my ability to trace recursion. However, much like math lectures, the problems being dealt with in class seems to me to feel easier when Professor Danny Heap is there to guide as along the way. Without him, I find it to be a bit more challenging. My main concern from this week and the past weeks is to be able to understand everything because I believe that the material in Computer Science is accumulative, and that if I don't understand something previously, that it will make it harder for me to understand something else in the future. In conclusion, I believe it is best to build the right foundation now since this is an introductory course in order for me to be able to succeed in the upcoming courses. I believe recursion is a useful tool that will help me become a better programmer.

Sunday, 2 February 2014

Week 4 CSC 148 Blog

This week in the CSC148 lectures, we started learning more about recursion. I found it to be very interesting way of approaching programming and I can see that it would be useful for a lot of situations in Computer Science. However, I still don't completely grasp the concept of it clearly, or rather when and in what situations to apply it. One thing that stood out to me this week in the lectures was the tracing of codes we did during the lectures. I found that I sometimes got my tracing right but sometimes I was also wrong. This week has made me realized that tracing is a lot more important than I perceived it to be when I was doing CSC108. I believe it is an area that I need to improve on and I think it will make me understand code a lot better than I previously have. Overall, I think the material I learned about this week will be useful and I hope that in the coming weeks that I will be able to grasp it more clearly and be able to apply it when I have to code.