13
you are viewing a single comment's thread
view the rest of the comments
[-] wewbull@feddit.uk 3 points 8 months ago

Maybe it's just the type of problems I work on, but I never find myself wanting a deque. A queue, absolutely. A stack, sometimes, A priority queue, occasionally.

Never a deque.

[-] neo@lemmy.hacktheplanet.be 3 points 8 months ago* (last edited 8 months ago)

I use a deque to fill a queue from the right, items get consumed from the left. Sometimes feedback from an external control mechanism will request an item be added to the queue with high priority. This item is then added to the left of the queue and will get consumed next, before all the others already in the queue. For me this was a good use case for a deque and it works well.

load more comments (2 replies)
this post was submitted on 18 Mar 2024
13 points (88.2% liked)

Python

6368 readers
15 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS