A22244. 对如下定义的循环单链表,横线处填写( )。class Node: def __init__(self, data): self.data = data self.next = None def create_list(value): head = Node(value) head.next = head return head def insert_tail(head, value): p = …
单选题
困难
知识点
题目描述
对如下定义的循环单链表,横线处填写( )。
class Node:
def __init__(self, data):
self.data = data
self.next = None
def create_list(value):
head = Node(value)
head.next = head
return head
def insert_tail(head, value):
p = head.next
while p.next != head:
p = p.next
node = Node(value)
p.next = node
node.next = head
def print_list(head):
_________________
while True:
print(p.data, end=" ")
p = p.next
if p == head:
break
print()选项(单选)
答案解析
详细答案解析为会员权益,按每日次数查看。
开通 / 升级会员
上一题
下一题