必须有可能遍历一个列表,删除元素并以高效的方式向开头添加一些新元素。在C中,我将使用链表,在python中遍历一个deque?
-3
A
回答
1
Python中有很多LinkedList实现的例子。我偶然发现了一个很好的... Python Linked List。如果你向下滚动一些,其他一些用户有一些好的实现要遵循。
相关问题
- 1. 遍历在Python
- 2. 遍历在Python
- 3. 遍历在Python
- 4. 遍历在Python
- 5. 在Python中预先遍历
- 6. Python:遍历一组符号
- 7. Python - 遍历类
- 8. 树遍历python
- 9. 在Python中遍历n遍历树并返回节点实例
- 10. 在PHP中循环遍历一个JSON
- 11. 在x86中遍历一个向量?
- 12. 在Ruby中递归遍历一个Hash
- 13. 遍历两个字典Python中
- 14. 在Python中一次遍历字符串2(或n)个字符
- 15. 我如何在python中一次遍历多个2d列表?
- 16. 在Python中一次遍历2个列表
- 17. 如何遍历在Python
- 18. 在python遍历计数对
- 19. 如何遍历在Python
- 20. 遍历使用Python
- 21. Python的 - 遍历list.append
- 22. 遍历列表(Python)
- 23. Python遍历字典
- 24. 在python中迭代deque
- 25. 在Python中循环遍历数字
- 26. 无法遍历一个div
- 27. 遍历一个BPEL数组
- 28. 循环遍历一个NSMutableArray
- 29. .filter遍历一个数组
- 30. 遍历一个图表
你的意思是[collections.deque](http://docs.python.org/library/collections.html#collections.deque)? – jfs 2012-07-28 23:09:40
是的 - 这是可能的。你试过什么了? – 2012-07-28 23:18:19
是的,我的意思是collections.deque。我想通过它删除一些元素并偶尔添加一些到开头。 – warsaga 2012-07-29 19:49:22