第26762题 单选题
完善双向链表的append()方法,在链表尾部添加新节点

基于上题代码正确的前提下,填入相应代码完善append()函数,用于在链表尾部增加新节点。

def append(self, data):
    new_node = self.Node(data)
    if self.is_empty():
        self.head = new_node
        self.tail = new_node
    else:
        # 此处补充代码
self._size += 1
return new_node
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析