用户:opjest_Redstone查看:1 回复:2 评论:1 创建时间:2020-03-17T12:04:42
点开始啥都没有,求助
"为啥会这样?"
def Output(ListValue, ListRight, head):
print(nex[head])
nex = nex[nex]
while (nex != 0):
print(ListRight[nex])
nex = ListRight[nex]
ListValue = [1, 5, 6, 2, 7, 3]
ListRight = [(-1), 5, 1, 0, 2, 3]
ListLeft = [(-1), 5, 1, 0, 2, 3]
head = 0
prepos = 5
Output(ListValue, ListRight, head)
print()
ListValue.append(4)
ListRight.append(nex[prepos])
ListLeft.append(prepos)
ListLeft[ListLeft[prepos]] = (len(ListValue) - 1)
ListRight[prepos] = (len(ListValue) - 1)
Output(ListValue, ListRight, head)
# 定义一个函数用于输出链表