class Solution: # 返回从尾部到头部的列表值序列,例如[1,2,3] def printListFromTailToHead(self, listNode): # write code here # 方法一 使用栈 if not listNode: return [] temp = [] result = [] while listNode: temp.append(listNode.val) # 进栈 listNode = listNode.next while temp: result.append(temp.pop()) # 出栈 return result # 方法二 ...