2014年3月16日星期日

week #8 --- Tree

This week, we learned about the Tree class. Based on this class, there were many methods and it extended some knowledge points. For example, recursion and subclass.

The tree list must have three element. The first element is root and the rest are their leaves. The leaves can be a new tree list and also can be None. Basically, we can do a lot of exercise about tree by ourselves. It seems like our exercise 3. We know the preorder and inorder tree list, and return the original tree list. After that, we wrote one more function about count the sum of deepest leaves from root for the tree list. For this kind of exercise, we can understand and apply recursion and writing the helper function inside the main function deeply.

For the computer science, every day we learn the different knowledge and every day we think the different methods for the function. We need to keep practicing everyday and improve our knowledge well. 

没有评论:

发表评论