2015年3月15日星期日

week9: impression of BST

In this week, the future class of BTNode is BST. The relationship between BTNode and BST is same as the LLNode and LinkedList. BST is built form many BTNode, but BST in not a list of BTNode instead of tuple type. In the other words, BST is an totally new class contains many BTNode in the class.
Many functions under the class also apply the thinking methods of BTNode class. For example,  the insert and delete function also use the recursion methods. I also respectively compare whether objects that insert or delete are greater or smaller than self.data and then compare information in the left and right children. In addition, BST has another statement,  self.root. As a result, when I insert or delete the value in BST, I need to add or minus one size in self.root and the other step is similar with BTNode.

没有评论:

发表评论