12
you are viewing a single comment's thread
view the rest of the comments
[-] wosat@lemmy.world 5 points 11 months ago

You can use a deque as a stack (First In, Last Out) or as a queue (First In, First Out). Lists are especially inefficient when adding/removing from the beginning of the list, but, for deques, it's a O(1) operation.

this post was submitted on 04 Oct 2023
12 points (100.0% liked)

Python

6145 readers
3 users here now

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

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

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

founded 1 year ago
MODERATORS