Friday, 20 March 2015

Week 9 impressions

In terms of material it would seem that week 9 wasn't exactly an abundance of information. Al though there isn't much write about there were some interesting topics about the the binary search tree (BST) involving the insert and delete functions. Initial reaction to the insert function is nothing special, to insert a node into the tree it's pretty straight forward, everything on the left is less, everything on the right is larger. It gets a little more confusing for  the delete function.

My difficulties and frustration come from the delete function as it gets more convoluted and complex when you need to delete a node in the middle of the tree. What happens to the rest of the nodes in the subtree? Do they need to be re inserted into the original tree? Even now the algorithm and code are a little hard to follow for me. I will be playing around more with mutating trees and testing code to get a better grasp on the topic in preparation for the final exam. Not too much to write about due to the midterm, The midterm itself , in my opinion, was harder than the first one but was not a problem if you kept up with lab exercises. Al though people that did not have prior knowledge may have had difficulty with the subject because of lack of labs to the strike.

Thursday, 12 March 2015

Week 8

My gut reactions to the linked list concept was one of relief to be sure. Working with trees beforehand, I found, was much harder than working with linked lists due to its branching structure. It was a nice change of pace from using recursive methods/ functions back to some loops. In my opinion the linked list structure is pretty straight forward, literally. the node points holds two pieces of information, the data and the pointer to the next node in the list. Fortunately I did have prior programming knowledge in linked lists in Java, I find linked lists, as with most structures, much easier to visualize and code in python, probably because visually the python language is more simplistic.

Initially, I did have small problems in programming the different functions in the linked list code because the percentage of making a simple error is rather large. When I was trying the lab most of the problems arose when I would begin to lose track of LLnodes because traversing the list with variables such as curr_node, prev etc, in a while loop, if not careful, could lead to infinite loops or lead to node pointers trying to point to a node after None which would lead to errors. I found that the advice of drawing a pictures to better refine an algorithm was best in minimizing such mistakes. To my relief, no major questions were created just a matter of refining my thinking towards linked list structures. Just in time for the midterm too.