Sunday, 8 March 2015

Summary of Week 7!

Hello blog readers! For week 7 we were introduced to binary trees in class! Binary trees are pretty much the tree structure we've looked at earlier in week 6 but specifically with only two children, which we usually refer to as the left and right sub tree. I learnt about the 3 different ways that you can traverse through binary trees as well. They are in-order (visiting a node between its children), post-order (visiting a node after its children) and pre-order traversal (visiting a node before its children). I also learnt about binary search trees in which at a specific node, the value for it is greater than all values in the left sub tree and less than all the values in the right sub tree.

The material was pretty easy to understand at first but implementing it definitely wasn't easy. When I first started looking at the lab questions, I kept thinking about how hard it would be because of how many limitations there were on certain things, such as the two branches for binary trees in the first couple of questions and the value restrictions for binary search trees later on. When I actually started to think about it more the conditions don't actually make it that much more complicated. The binary trees only have the two branches and I check the left and the right sub tree, and the binary search trees for the later on functions such as list_between actually can be easier because now instead of checking the entire tree for values between certain values, you can know because the left sub tree and right sub tree will have values less then and greater than its parent. However, I'm still not entirely confident on being able to write these concepts on a test, mainly because it took me a bit of time to figure this out, and on a test with really limited time, I'm not too sure I'd be able to think of a way to solve problems with this that fast. I'll look at some past tests for sure with some binary trees so I can have a bit more practice with this, and hopefully with more exposure I'll be a bit more confident in the material.

Well, that's all for this week folks! I'll see you guys next week in my next post!


No comments:

Post a Comment