Saturday, 14 March 2015

WEEK 9 ~ BSTs & LinkedLists

     

     Working with BSTs and LinkedLists are actually quite interesting. I noticed from doing the labs that there are many ways for iterating over the same trees and still getting the same results. However, this also means that the order in which the trees are iterated over effects the order of the results. This part was a bit challenging for me when working with BSTs. It was challenging for me to return the nodes of a tree in order from smallest to largest (or vice versa) without using the sort method. The only method I can think of is iterating over the nodes until the smallest is found (and then returning it in a list) and then re-iterating over the tree in the same way until all the nodes are listed from smallest to largest. 

     For LinkedLists it was a tad bit harder than just working with BSTs. This is only because we are working with two classes at the same time; LLNode and LinkedLists. Being able to add in new nodes using LLNode is helpful but I still tend to mix up some of the objects between the two classes (self.value and self.data). 

     Nevertheless, there are so many ways to mutate a LinkedList and I hope to be able to master the techniques shown in class for this week (i.e. insert and delete). 

     Cheers
   
     P.S It's the ultimate Pi Day today!!! 3.14.15 !!!

No comments:

Post a Comment

I'm open to any feedback! Thanks!