Python deques链接列表吗? [英] Are Python deques linked lists?
问题描述
我正在寻找一个链表实现。在列表中的任何位置插入常量时间
可迭代的东西。我想知道deque()是否是要使用的课程,或者是否还有别的东西。有吗?
谢谢...
12月10日上午9:43,Just Another环境道德的受害者
< ihates ... @ hotmail.comwrote:
我正在寻找一个链表实现。在列表中的任何位置插入常量时间
可迭代的东西。
它位于燃素罐和永久
运动机器之间的架子上。
2007-12-12,环境道德的另一个受害者
< ih ******* @ hotmail.comwrote:
我正在寻找一个链表实现。东西
迭代,在列表中的任何位置插入常量时间。我想知道deque()是否是要使用的类,或者是否有
其他的东西。在那儿?
deque实现为数组列表。有关使用旋转从
deque中删除项目的技巧,请参阅5.12.1食谱
。然而,文档并没有说明旋转方法的效率(以O
表示法)。您将检查
来源,或者Raymond正在阅读并可以解释。
-
Neil Cerutti
12月9日下午10:54,John Machin< sjmac ... @ lexicon.netwrote:
12月10日上午9:43,只是环境道德的另一个受害者
< ihates ... @ hotmail.comwrote:
< blockquote class =post_quotes>
我正在寻找一个链表实现。在列表中的任何位置插入常量时间
可迭代的东西。
这是在燃烧的jar和永久的
运动机器之间的架子上。
我建议您快速浏览链表上的任何文章。
这里有一个: http://en.wikipedia.org/wiki/Linked_list
-
Arnaud
I''m looking for a linked list implementation. Something iterable with
constant time insertion anywhere in the list. I was wondering if deque() is
the class to use or if there''s something else. Is there?
Thank you...
On Dec 10, 9:43 am, "Just Another Victim of the Ambient Morality"
<ihates...@hotmail.comwrote:I''m looking for a linked list implementation. Something iterable with
constant time insertion anywhere in the list.It''s on the shelf between the jar of phlogiston and the perpetual
motion machine.
On 2007-12-09, Just Another Victim of the Ambient Morality
<ih*******@hotmail.comwrote:I''m looking for a linked list implementation. Something
iterable with constant time insertion anywhere in the list. I
was wondering if deque() is the class to use or if there''s
something else. Is there?The deque is implemented as a list of arrays. See 5.12.1 Recipes
for the trick of using rotate to delete an item from within the
deque. The docs don''t spell out the efficiency (in terms of O
notation) of the rotate method, though. You''ll have check the
source, or perhaps Raymond is reading and could explain.
--
Neil Cerutti
On Dec 9, 10:54 pm, John Machin <sjmac...@lexicon.netwrote:On Dec 10, 9:43 am, "Just Another Victim of the Ambient Morality"
<ihates...@hotmail.comwrote:I''m looking for a linked list implementation. Something iterable with
constant time insertion anywhere in the list.
It''s on the shelf between the jar of phlogiston and the perpetual
motion machine.I recommend a quick glance at any article on linked list.
Here''s one: http://en.wikipedia.org/wiki/Linked_list
--
Arnaud
这篇关于Python deques链接列表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!