In this week, we are learning about Tree such as BinaryTree, which has left and right children, that can be none, and LinkedList, which is similar as Tree in format. The differences between Tree and LinkedList are in picture, insert and del. To insert other thing into LinkedList, replace it to its value, and the rest is in its children. To do some work, we still need recursion like preorder, inorder, and postorder.
In addition, I am still confused about recursion, and I cannot do recursion successfully at once, I need revise it again and again. And I did not finish my lab this week. The first problem is that I did not discuss question in different situations, for example, In LinkedList, to calculate its length when its rest is None, and is not None. But when I did this, I use recursion, and wanted to finish it by one case, and got errors. Secondly, I did not understand how it works that makes me confused how to do it.
From these experiments, I need to continue to do lots of exercise of recursion, and tree, Linkedlist to know how it works.
The nodes in Tree only have one children. The sequence is linked list. How do you think?
ReplyDeleteTree only has one child?
Delete