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.

No comments:

Post a Comment