剑指offer python版 9.2用两个队列实现栈

''' 用两个队列来实现一个栈,完成栈的Push和Pop操做。 栈中的元素为int类型。 ''' class Solution: def __init__(self): self.queue1 = [] self.queue2 = [] def push(self, x): if self.queue2 == []:
相关文章
相关标签/搜索