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

A18711. 下面代码遍历并输出一个循环单链表,其中 head 指向链表的第一个节点,横线处应填入的是( )。class Node: def __init__(self, val): self.val = val self.next = None def printList(head): if head is None: return p = head _______________________ prin…

单选题 困难

题目描述

下面代码遍历并输出一个循环单链表,其中 head 指向链表的第一个节点,横线处应填入的是(    )。

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

def printList(head):
    if head is None:
        return
    p = head
    _______________________
    print()

选项(单选)

上一题 下一题