• fr0g@feddit.de
    link
    fedilink
    arrow-up
    2
    arrow-down
    4
    ·
    1 year ago

    When you need a doubly-linked list in Python, you can use the deque data structure, which is in the collections module

    When do I need a doubly-linked list in Python? Whenever I have something where I can often expect to interact with the first and last element of it? Always, because it’s more efficient than shifting the entire list around? Something else entirely?