猫史档案馆


Python 疑问

用户:opjest_Redstoneopjest_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)

# 定义一个函数用于输出链表

 


回复

上一页1 页 / 共 1下一页
wrmdcxywrmdcxy

还没调用呢.......................

点赞0


评论


飞火天703飞火天703

你没调用,只是做好了函数

 

点赞0


评论