Python collections 模块中的 deque(队列)

collections.deque介绍 collections 是 python 内建的一个集合模块,里面封装了许多集合类,其中队列相关的集合只有一个:deque。deque 是双边队列(double-ended queue),具备队列和栈的性质,在 list 的基础上增长了移动、旋转和增删等。python 经常使用方法 d = collections.deque([]) d.append('a'
相关文章
相关标签/搜索