博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
deque
阅读量:4031 次
发布时间:2019-05-24

本文共 722 字,大约阅读时间需要 2 分钟。

class 
collections.
deque
(
[
iterable
[
maxlen
]
]
)

Returns a new deque object initialized left-to-right (using ) with data from iterable. If iterable is not specified, the new deque is empty.

Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction.

Though  objects support similar operations, they are optimized for fast fixed-length operations and incur O(n) memory movement costs for pop(0) and insert(0, v) operations which change both the size and position of the underlying data representation.

转载地址:http://nqhbi.baihongyu.com/

你可能感兴趣的文章
POJ 2470 Ambiguous permutation(我的水题之路——位置和值的队列)
查看>>
POJ 2498 StuPId(我的水题之路——from back to front- -!)
查看>>
POJ 2535 Very Simple Problem(我的水题之路——看错题)
查看>>
POJ 2538 WERTYU(我的水题之路——键盘错位)
查看>>
POJ 2551 Ones(我的水题之路——重点,末尾有几个1)
查看>>
POJ 2562 Primary Arithmetic(我的水题之路——模拟加法进位)
查看>>
POJ 2575 Jolly Jumpers(我的水题之路——数组绝对差值为1到n-1)
查看>>
POJ 2578 Keep on Truckin'(我的水题之路——谁先大于168)
查看>>
POJ 2579 Blurred Vision(我的水题之路——四方格平均值)
查看>>
POJ 2591 Set Definition(我的水题之路——又一个丑数)
查看>>
POJ 2606 Rabbit hunt(我的水题之路——斜率最多)
查看>>
POJ 2608 Soundex(我的水题之路——字符值)
查看>>
POJ 2636 Electrical Outlets(我的水题之路——水,电器接头)
查看>>
POJ 2656 Unhappy Jinjin(我的水题之路——不开心的学习日)
查看>>
POJ 2664 Prerequisites?(我的水题之路——选课)
查看>>
POJ 2665 Trees(我的水题之路——移树,POJ100题啦!)
查看>>
POJ 2840 Big Clock(我的水题之路——水,钟)
查看>>
POJ 2864 Pascal Library(我的水题之路——都来了么)
查看>>
POJ 2871 A Simple Question of Chemistry(我的水题之路——数列两数之差 )
查看>>
POJ 2909 Goldbach's Conjecture(我的水题之路——任一数为素数对之和)
查看>>