This week, I have learnt a new class named LinkedlistNode, which is a little different from other class. It has more visual picture in their printing. However, they also have some similar elements between LinkedlistNode and Tree or BTnode. the node.nxt in LinkedNode has the similar meaning like the children in Tree or Btnode. In the other hand, it has different method of calculation in function. For example, there are many recursion using in Tree and Btnode, because there can consider their children or left and right leaves to finish all situations in the class.
In the LinkedlistNode class, we use another method - while loop as the main idea in the function. For example, in the __add__function, we us while loop and cur_node = cur_node.nxt to circulate the whole LinkedlistNode. This is an other method of circulation.
没有评论:
发表评论