Sunday, 2 March 2014

Week 6

This week we learned about Binary Trees and just Trees in general. Even though this data structure is called a Tree, it has nothing to do with a real tree, except some of its characteristics that match a real tree. Of course, you don't need to know about a real tree to understand what the Tree's characteristics mean.

A Tree has a root, branches and leaves. Leaves are the outermost objects that have no children. Roots are the parents of children and branches are what connects parents and children. Roots start out empty and you can fill the left and right sides of it and then do the same for those.

You can trace trees using recursion; meaning you can calculate its height or find a specific element just by going through the tree.

We also did a list-of-lists implementation of Binary Tree, which was moderately easy enough to follow and understand. I was even able to re-write the implementation at home a few hours later without having to look at class notes at all.

The test went well and I am happy with my mark, considering I was quite ill and barely had enough strength to make it to class without vomiting brutally.

No comments:

Post a Comment