In week 7, we studied Binary search trees, which is an Abstract Data Type.
I personally find trees to be quiet easy. It is an application to recursion which uses functions recursively to return the base case and to solve the problem.Since at this point I am quiet seasoned with recursion already, I didn't find trees to be hard.
Binary search trees is just a special kind of tree. Each node of binary tree is only allowed to have two children, and the child to the left of the node must be smaller than the child, while the children to the right must be greater. This feature of binary search tree makes it very convenient for programmers to operate with this. This is because programmers can divide the tree easily into left and right side, based on the the value of the root, and perform operations to both sides. I also assume that this feature allows the program to execute much quickly compared to if we perform operations on the entire tree as a whole.
Furthermore, I also find Binary Search Tree to be much easier than Binary Tree. The fact that it only has two organized children makes it much more predictable than Binary Tree. Hopefully I am right with this impression and binary tree does not become infinitely hard :-).
In addition to binary search tree, we also discussed about Tree traversal this week.I actually find that Tree traversal to be quiet straight forward. Inorder search will always leave the node at the middle, which means the root will always be in the middle of an in-order search. Pre-order search will always have the node in front, then visits the children. And post-order search will always have the node at the end. Using these property, if we are given a list of how the nodes are being reached by each search method, we can easily reconstruct the tree. This is why Tree Traversal is important.
Also, we worked on the assignment this week as a group. I actually think the assignment was a little bit too hard, but my team and I made good progress and finished one required file which is Tippy.move. That was a good achievement!
没有评论:
发表评论