python的list是动态数组(Dynamic array - Wikipedia)。
Python里面的Doubly linked list(双向链表)是用 collections 模块里的 deque。
1 | > python -mtimeit -s 'import collections' -s 'c = collections.deque(xrange(1, 100000000))' 'c.pop()' |
python的list是动态数组(Dynamic array - Wikipedia)。
Python里面的Doubly linked list(双向链表)是用 collections 模块里的 deque。
1 | > python -mtimeit -s 'import collections' -s 'c = collections.deque(xrange(1, 100000000))' 'c.pop()' |