Saturday, 28 March 2015

Week 11 - Revisiting an Earlier Blog Post

This week, I will be revisiting the blog post of Week 4. Back in week 4, we had just finished talking about classes and inheritance and we were simply introduced to the definition of recursion. At the time, inheritance was quite a new concept for me, and I also found the course material to be very easy. I thought that the course would be a breeze due to level of easiness of the material we were exposed to in the beginning of the course. I was also very excited because of the new friends I had made in the course that I found on Facebook while looking for partners for Assignment 1. I was very optimistic in Week 4, and I was also over confident, because I thought that the course material was too easy and I would get by without doing a lot of work like I did in CSC108. I WAS WRONG!

Looking back, I agree with my earlier blog post (week 4) when I said that I find the course material very interesting. At the time, I found inheritance to be an interesting concept, and I believed that the entire course would have many more interesting things to come. I was absolutely correct in that regard. In fact, recursion turned out to be very interesting and beautiful. Recursive algorithms have the power to take in a huge problem and break it down into tiny steps. As the course progressed, I had a lot of fun writing recursive code for labs and assignments. Additionally, I found Assignment 2 the most interesting part of the course. I had to write a strategy for a game that would always choose the best possible move, called Minimax. It used recursion to create a game tree, and choose a move that would lead the computer to always win the game. I was fascinated by the power of recursion, and the beauty of what we can do with just some simple coding! Therefore, I agree with my blog post of Week 4 when I say that the course material seems very interesting and fun.

However, I completely disagree with my blog post (of week 4) when I talk about how I feel the material of the course is very easy. As the course progressed, the material of the course got harder and harder. Although I found recursion to be a very interesting concept, I also found it to be very challenging. It was hard for me to understand how to trace recursion at first, but it was even harder for me to write recursive code. Whenever given a problem, I would jump write to writing code without understanding the problem fully, and drawing out trees to see what I would like to function to return at every step, like we were told to do so in class. I even struggled with traversing through linked lists when first introduced to the topic of linked lists. Therefore, I disagree with my comment on how I felt that the course is easy back in Week 4.

I agree with myself when I say that it is essential to go to lectures. Lectures in CSC148 provide the basic foundation and understanding of the course material. The professor goes through basic concepts and provides examples related to the topic, which helps us get started on the labs. Additionally, the professor explains more in detail of what he expects us to do in the assignments. Therefore, without going to lectures, my performance in the course would be very poor. So I agree with my week 4 blog post when I said that going to lectures would drastically improve my performance in the course.

Looking back at my previous SLOG, I agree with the blogger with the link (http://dingtaoliu.blogspot.ca/2015/03/csc148-marth-30th-2015.html). Similar to this blogger, we both now realize that drawing trees and understanding what each step of the tree should return is very important and useful when solving a problem in involving recursion. We both are looking back and laughing at how we used to rush into writing recursive code without fully understanding the problem. Similar to this blogger, I too used to guess and check when solving recursive algorithms. I used to write up something related to what we did in lecture and hope it would work in lab questions, which is quite foolish. Furthermore, I also agree with the blogger when he says that the best way to think about recursive algorithms is understanding the fact that whatever the recursive code asks it's children, it will also ask it's grandchildren and so on. So it is best to think of only one relation, rather than tracing through the entire true manually.

I am glad that my experiences of looking back are similar to the blogger (http://dingtaoliu.blogspot.ca/2015/03/csc148-marth-30th-2015.html). It shows that we both learned a lot in the course and we both learned more efficient ways to tackle problems. I look forward to next week, as it is the last week of the course!

Saturday, 14 March 2015

Week 9 - Impressions of Week 8

This past week, we covered the topic of linked lists. Linked lists are made up of nodes, and each node refers to the next node in the list. I found this topic to be interesting. Even before the professor went into more depth about linked lists, I immediately began to think about how I would traverse through a linked list from the diagrams the professor drew showing the link between nodes. Each node refers to another node, so to traverse through a linked list, I learned that it is best to go through each node and the node behind it at the same time. One way to do this is by having initially setting current_node = lnk.front, where lnk.front is the first node in the linked list, and by setting previous_node = None. Then as long as there is a node in front of current_node, which would be current_node.nxt, we can set current_node = current_node.nxt and previous_node = current_node. I found this approach to be quite interesting, although it is very logical.

I really enjoyed working on the lab exercises after the lecture on Wednesday night. There were no labs this week, so I started to work on the lab exercises early to ensure that if there is a concept that I don't understand, I can speak with the professor late this week or early next week. One thing that I realized is that doing lab exercises the same day as the lecture is a lot more effective than doing them the night of the next day, because the material is fresh in my head. What I found even more effective is by re doing those lab exercises the next day to ensure that the material I covered is well understood. Although there were some functions that I was not able to implement on my own, I now understand the value of doing things early rather than leaving things to the last minute. Thanks to the fact that I spent a lot of time practicing by doing lab problems right after the lecture, I was able to gain a more solid and in depth understanding of how to traverse through linked lists. I was also able to seek help from the professor with the functions that I could not successfully implement at the end of last week, which got me well prepared for the test.

One thing that I will do in order to continue my improvement in the course is print out Final Exams from previous years on April 4 in order to practice the material covered all together in the course. I will continue to seek help during the professors' office hours when necessary, because they are like golden gems when we are stuck on problems. Firstly, they draw diagrams to ensure we understand what the problem is asking and what it should return in every step/how it should work. Secondly, they guide us through every step of the problem, so that we understand what the code does at every step of the way, and sometimes, they leave us with another very similar problem for us to think about as review for what we learned in their office. Office hours have really helped me understand multiple concepts, and I will continue to take advantage of the office hours when I am stuck on a problem. Although I feel as though I have a solid grasp on the material that has been covered thus far in the course, I believe it is essential to keep practicing by solving problems, so I will continue to do that often until the day of the Final Exam to ensure I don't forget anything.

My experiences in the course are similar to the blogger (http://5529405871.blogspot.ca/2015/03/week-8-linked-lists.html). Similar to this blogger, I also found the concepts of linked lists interesting, but challenging to implement at first. For each problem, I had to draw multiple diagrams first to visualize what my code should do, and then I started to write code. As time passed by, I found the material less challenging. Additionally, similar to this blogger, I also wish that my code was simple and elegant when implementing functions in Lab 7. Although I was happy that I was able to get many of my functions to work, I had a lot of unnecessary code in my solutions, which is something experienced with this blogger as well. It is interesting for me to see that this blogger has similar experiences to me as well, because it shows me that many of us have the same struggles and learning processes.

I can't wait till next week!

Saturday, 7 March 2015

Week 8 - Impressions of Week 7

This past week, we covered the topic of Binary Trees and Binary Search Trees. A binary tree is a tree where each node can have between 0 to 2 children. A binary search tree is a binary tree where the left sub-tree of each node has values that are always less than the node and the right sub-tree of each node has values that are always greater than the node. We also talked about how to write recursive code effectively when using using recursion on binary search trees.  I personally had trouble understanding how to use recursion on binary trees, and in order to understand the logic behind it, I had to think of a few examples and ask myself: How to solve these problems recursively. I saw that conceptually, it is not any different than a regular tree. The only difference is that binary trees can have at most two nodes, so instead of using a for loop to iterate over each child, we can call the recursive function on the left sub-tree, visit the node, and then call the recursive function on the right sub-tree.

We also talked about different ways to traverse through a binary tree. One method of traversal is called inorder. In this method, we first visit the left sub-tree, then the node itself, and then the right sub-tree. Another method is called preorder. In this method, we first visit the node itself, then the left sub-tree, and then the right sub-tree. Finally, we have another method called postorder. In this method we first visit the left sub-tree, then the right sub-tree, and then the node. These are three recursive definitions. Personally, I found it easier to remember the fact that no matter which method we are using, we always visit the left sub-tree before the right. Therefore, these three methods only differ by which position we visit the node. In preorder, the node is visited first, in inorder, it is visited second, and in postorder, it is visited last. This is how I remember the difference between these three recursive definitions.

One thing I will do to improve my performance in this course is help out some friends with course concepts that they have difficulty with, or problems in which they have trouble solving. Whenever I have trouble, I ask some friends to explain certain concepts to me. This helps me out a lot, and I've noticed that it also helps them improve their communication skills and the material that they explain gets reviewed in their heads as well. I believe that if I assist some friends with problems that they have had trouble solving, the material that I am assisting my friends with will never escape my mind, and it will also help me improve my communication and teaching skills. This will be the ultimate review, and it will help out somebody else as well. I also plan on solving as many problems as possible, whether they be from past tests, exams, or additional lab exercises, because although I may understand the concepts in the course, applying the concepts has always been a challenge for me, and in this course, applying the concepts we learned is essential.

I agree with the blog entry of (http://ak148slogaddress.blogspot.ca/2015/03/w8.html). Having a team for Assignment 2 really does help in getting a lot of the work done, because sometimes I might understand something that they don't and sometimes they may understand something that I don't. We can fill in each other's gaps and at the end of the day, we all end up learning something. Furthermore, I also feel as though I have learned a lot about object oriented programming, because whenever we get stuck on a particular concept, my group members and I help each other out, which is the same case with the blogger. We both have excellent group members who work with us not only on assignments, but also have discussions about course concepts and lab problems. I am glad the blogger is having a great experience in course, and I, along with the blogger, am thankful for having such a fantastic team to work with.