Sunday, 15 March 2015

SLOG Week 8: Impressions of Week 7

Lectures:
For lectures this week, we mainly talked about binary trees and binary search trees. Basically, a binary tree is a tree where each node has at most 2 children.  We also learned three ways to traverse a binary tree. The three were preorder, inorder, and postorder. The easiest way to remember them is that in preorder, the middle node is visited first then the left then the right. In inorder, the left node is first, then the middle, then the right. In postorder, the left is first, then right, then middle. The name of the traversal tells you when to visit the middle node and the left is always before the right.

We also learned about a special type of binary tree called a binary search tree. In this tree, each node has a numerical value. The left node always has a lower value and the right node has a larger value.

Overall, these concepts were not too hard to understand. Although coding recursion for things like this sound very difficult to do.

Lab:
During week 7's lab we had a lot of practice working with binary trees and coding recursion using binary trees. This was very good practice in learning how to deal with recursive problems using binary trees. There are some lab exercises that I couldn't finish during the 2 hour lab period that I am planning to work on at home.

No comments:

Post a Comment