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