Friday, 13 February 2015

Week 6 SLOG

For the past two weeks we have been learning about Abstract Data Types, specifiaclly stacks and trees. Before doing the lab, we had only briefly touched upon stacks in class, therefore I had to reread the lecture notes a couple of times before I knew how to complete the lab questions. Next, for this week's lab was the topic: Trees. In the lecture, in order to fully understand trees, we created our own real life tree in which one student at the back of the class was the root with two children, and each of those children had their own two children, and so on until every student in the class was part of the tree. We then began to figure out the height of the tree, and other aspects based on our real life tree. I found this really helped my understanding of how trees actually looked, and how they delegated specific tasks to their children. At first, I was kind of confused as to how to complete the function bodies for the various functions in the lab, but after looking up some examples I got the hang of it, and I realized that trees are quite simply another form of recursion. Knowing this greatly helped me to proceed and complete the rest of the function bodies.

No comments:

Post a Comment