双端队列免切片返回
从尾到头打印链表
http://www.nowcoder.com/questionTerminal/d0267f7f55b3412ba93bd35cfa8e8035
from collections import deque class Solution: # 返回从尾部到头部的列表值序列,例如[1,2,3] def printListFromTailToHead(self, listNode): # write code here result = deque() while listNode: result.appendleft(listNode.val) listNode = listNode.next return result