测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A18712. 假设 head 不为空,下面是实现单向循环链表在头节点后插入新节点的代码,横线处应填入( )。class Node: def __init__(self, val): self.val = val self.next = None def insert_after_head(head, x): new_node = Node(x) ____________________

单选题 困难

题目描述

假设 head 不为空,下面是实现单向循环链表在头节点后插入新节点的代码,横线处应填入(    )。

class Node:
    def __init__(self, val):
        self.val = val
        self.next = None

def insert_after_head(head, x):
    new_node = Node(x)
    ____________________

选项(单选)

上一题 下一题