3 ms·
Correct (actually a linked list of blocks[1]). It supports insertion and removal from both ends in O(1), which is very useful. However, it does not support inse
by hddqsb 4y ago
Correct (actually a linked list of blocks[1]). It supports insertion and removal from both ends in O(1), which is very useful. However, it does not support insertion and removal from the middle (via an iterator) in O(1), so it's not a complete replacement for doubly-linked lists.
[1]: https://github.com/python/cpython/blob/a4ac14faa5c2be433738dfbbed14b0eaa1a2399e/Modules/_collectionsmodule.c#L31 https://github.com/python/cpython/blob/a4ac14faa5c2be433738d...