Wednesday, 25 March 2015

Revisit of Week 4 SLOG

While writing my week 4 SLOG (topic: impression of the first few weeks of the course), I discussed the topics of writing classes, and writing the important methods that are needed for classes, and subclasses. While I was learning this for the first time, and trying to understant what "self" actually meant (becasue at the time it seemed so anstract), I found it a bit difficult to understand. However, since the beginning of the year I was required to write so many classes for different topic including: recursion, trees, BST's and so on, that now implementing all of these methods seem secornd nature to me. I find that I no longer need to over think the implemetation of methods and focus on implementing the functions in the class to perform the desired action.

While working on my first assignement, I mentioned in my week 4 SLOG that I had originally had difficulty understanding how the game was supposed to run, and what exactly I was supposed to do. But after I got over the initial problems in assignement 1, I found I was able to complete assignment 2 quicker, which was a sequal to assignement 1 in which we were taking our game a step forward and designing a strategy for the coputer to use while playing. This strategy was however, painstakingly slow so in assignemnt 3 we will focus on coming up with a strategy to make the strategy run quicker!

Friday, 13 March 2015

Week 9 SLOG

During this past week we learned how to mutate binary search trees by inserting or deleting nodes. We began by looking at different scenarios, and deciding how we would delete a specific node so that the BST chracteristics still remained. First, we worked with deteting the root of the BST when the tree had only either a left child or a right child, but not both. In this case, the root of the subtree would become the new node. The diffuculty arose when we tried to delete a node that was the root of both a left child and a right child. In order to figure out this problem, we tried to find another node in the existing tree that would still satisfy the properties of the BST if the said node were to replace the deleted node. By doing this, we learned that either the maximum of the left nodes or the minimum of the right nodes would work in this situation. Overall, I didn't feel that comfortable with the material from this  week's class because we only had one lecture due to the midterm this week. Working on the lab however, might fix this problem.

In terms of the midterm this week, I felt pretty nervous about working with linked lists, so I spent most of my time reviewing the code for linked lists that my instructor posted on the website. Overall, I think that the test was pretty fair.

Sunday, 8 March 2015

Week 8 Slog

This week we learned all about linked lists which are a linear sequance of nodes which keep track of which section is the front and which section is the back. This whole topic was completely new to me. I think linked lists are very interesting and useful because they are able to keep track of sublists of informtion which are related to each other. We also learned how to traverse across linked lists which is useful for mutating. Mutating across linked lists will give us the necessary practice needed to be able to mutate trees in the future which are much more difficult to mutate. Finally, we learned that since mutations allow for much more errors, it is essential to draw diagrams of linked lists and how a mutation will affect a linked list.
Some problems that I had this week had to do with lab 7 and implementing the various functions. Previously in class, we had only talked about what exactly a linked list was, and what it represented, as well as seeing the __init__ method. However, we had not yet worked with linked lists so I was not sure how to ewrite methods for them, and I was also quite confused as to what the various functions in the lab were supposed to do. In order to combat this problem, I reread the lecture notes seral times, and sought out extra materials about linked lists and how to implement their functions. I then compared my functions with the sample solutions that were posted a few days later, and made the required corrections for my notes.