First of all, it is the initialized function of tree class.
Secondly, there are some method about tree class.
It is the method about counting leaves(nodes with no children). In this method, we use a recursion to guarantee to get the basic nodes of the tree.
It is the method about counting internal nodes (node with one or more children). In this method, we use a recursion to find out all the nodes which does not have children from the root to the basis.



没有评论:
发表评论