Hi, everyone!
The second term test is approaching, which makes me quite nervous, given that I had bad performance in some exercises in recent labs. Basically, we have been dealing with recursive method in the last few weeks. Since week 7, we are required to apply recursive method in Linkedlist, Binary Search Tree, and Linked Binary Tree. In my opinion, the linked binary tree is the most challenging one. At the beginning, I tried to get a one dimension list from a given binary tree and the use the list to produce, but Ta said that was not the point of this exercise. When the solution to the lab released, I realized that we were supposed to use tuple to combine binary tree with linked list, which was a little bit similar to what we had done in exercise 3.
In lab 8, we were dealing with recursive method in Binary Search Tree. We were required to implement a recursive method to count the number of items in BST which are smaller than the given one. I remembered we were trapped after figuring out the base case. When the solution was released, we know the main point of this method is to use the property of BST. If the root is less than item, then we should count the root + left tree and do left tree + right tree in the other case. And the hard part of this lab is to understand the difference between 3 kinds of method, which has different base cases and result in huge difference.
Wish everyone good luck in the test!!
I also got stuck in lab 8. When I saw the solution, I felt the properties of BST was so useful.
回复删除We have learned Binary Tree and Binary Search Tree. All of this will cover in Term test 2
回复删除