📜  如何添加到链表的末尾python代码示例

📅  最后修改于: 2022-03-11 14:46:23.636000             🧑  作者: Mango

代码示例1
def insert_at_end(self, data):
        new_node = Node(data)
        if self.start_node is None:
            self.start_node = new_node
            return
        n = self.start_node
        while n.ref is not None:
            n= n.ref
        n.ref = new_node;