2015年2月15日星期日

A summary of oriented object

In the last week I learned a special class of oriented objects: Tree. The Tree class has the structure in which each nodes have connection with each other with no loop-like connection in it. What's more, it has a hierarchical structure in it. Though I still don't know when exactly to use the structure, but if I encounter code like this, implementing the Tree class can be very useful.

What's more, when expanding the Tree structure with nested list or other sequences, we have to implement the recursion and queue things we learned before.Like when implementing the descendents_from_list method, the queue class is imported while using the contains method the recursion is useful since we may encounter some complicated structure. It becomes hard for me to understand some of the code described in the slides and the Python draft in that it combines all the things we have learned so far. But I'll try to figure it out anyway.

没有评论:

发表评论