Sunday, 16 February 2014

Week 6: Trees and Finishing Up the Assignment

    The course material cover for week 6 was about a new type of data structure: binary trees. From what I remember, I have seen this during last week's lab. Binary trees are consisted of nodes and edges. When there are many nodes, those nodes become special. Each node can be seen as a root and some of them have children (maximum of two) and each child could also have children too. A node with no children is called a leaf. Some more definitions were covered in class.

    During the lectures, I was shown two implementations of binary trees. One used nested list, just like from the past lab. the 0-th element in the list is the node and the next two were the children. If there were no children, NoneType was in those places, otherwise it was another list. The second was basically the same except it was just a tree, meaning there could be any number of children, and we created trees objects.

    Because my partner and I were tired from mid-terms of other classes, we did not try much on the lab exercises. However, I though this weeks lab was quite easy. We had not much of a problem changing list comprehension to creating lists in the old/traditional way.

No comments:

Post a Comment