class Solution:## 标题
def printListFromTailToHead(self , listNode):
# write code here
# write code here
stack = []
while (listNode != None):
stack.append(listNode.val)
listNode = listNode.next
return stack[::-1] //反向打印输出
反向打印链表值
最新推荐文章于 2022-04-28 11:20:14 发布