(self, path, data, para, is_end_node=0, no_cutting=0, rebuild=0)
return True
向树种插入一个节点,该节点挂在path的末端

        Args:
            path: 节点的父目录
            data: 节点数据
            no_cutting: 该节点不剪枝 ，如果no_cutting==1，则该节点不减枝
        Returns:
向树种插入一个节点,该节点挂在path的末端
向树种插入一个节点 该节点挂在path的末端
def insert_node(self, path, data, para, is_end_node=0, no_cutting=0, rebuild=0):
        """ 向树种插入一个节点,该节点挂在path的末端

        Args:
            path: 节点的父目录
            data: 节点数据
            no_cutting: 该节点不剪枝 ，如果no_cutting==1，则该节点不减枝
        Returns:

        """
        NO_CUTTING = 0
        if rebuild == 0:
            NO_CUTTING = para['NO_CUTTING']
        leaf_num = para['leaf_num']

        cur = self._head
        for step in path:
            if cur._change_to_leaf == 1:
                return False
            if not cur.find_child_node(step):
                return False
            else:
                cur = cur.find_child_node(step)

        for child in cur.get_children():
            if child.get_data() == data:
                if child.is_end_node == 0:
                    child.is_end_node = is_end_node
                return False

        new_node = Node(data)
        if rebuild == 1:
            new_node._no_cutting = 1
        elif no_cutting and NO_CUTTING:
            new_node._no_cutting = 1
        new_node.is_end_node = is_end_node
        cur.add_child_node(new_node, leaf_num)

        return True
def insert_node ( self , path , data , para , is_end_node = 0 , no_cutting = 0 , rebuild = 0 ) : NO_CUTTING = 0 if rebuild == 0 : NO_CUTTING = para [ 'NO_CUTTING' ] leaf_num = para [ 'leaf_num' ] cur = self . _head for step in path : if cur . _change_to_leaf == 1 : return False if not cur . find_child_node ( step ) : return False else : cur = cur . find_child_node ( step ) for child in cur . get_children ( ) : if child . get_data ( ) == data : if child . is_end_node == 0 : child . is_end_node = is_end_node return False new_node = Node ( data ) if rebuild == 1 : new_node . _no_cutting = 1 elif no_cutting and NO_CUTTING : new_node . _no_cutting = 1 new_node . is_end_node = is_end_node cur . add_child_node ( new_node , leaf_num ) return True