Skip to content
Advertisement

Tag: deque

Initialize deque efficiently

I am using a deque to store data that is going to be processed. The processing only starts when the deque is full so in a first step I fill my buffer the following way: However, when I do this and I modify one of the elements of my_deque, all elements of my_deque are modified. One alternative I found to

delete the hashed node in deque in O(1)

How do I hash a built-in node in deque (which is a double linked list) and delete the node in the middle in O(1)? Is the built-in node exposed? For example, I want to save a deque’s node in dict so I can delete the node in constant time later. This is a use case in LRU, using deque so

Advertisement