---
title: "Using Queues and Stacks in Python with Its collections Library"
url: https://daily.dev/posts/using-queues-and-stacks-in-python-with-its-collections-library-nqrnlfovm
source_url: https://python.plainenglish.io/using-queues-and-stacks-in-python-with-its-collections-library-6e7a097af44b
type: article
source: "Python in Plain English"
published: 2024-05-17T07:20:19.156Z
updated: 2024-05-17T07:20:32.382Z
tags: ["python", "data-structures"]
reading_time: 5
upvotes: 35
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Queues and Stacks in Python with Its collections Library

**[Python in Plain English](https://daily.dev/sources/inPlainEngHQ)** · 5 min read · 35 upvotes · 0 comments

## Summary

This post discusses the 'deque' object in Python's 'collections' library and how it can be used to implement queues and stacks. It compares the performance of using a 'deque' vs a 'list' for queue and stack operations, highlighting the faster speed of 'deque'.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://python.plainenglish.io/using-queues-and-stacks-in-python-with-its-collections-library-6e7a097af44b>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#data-structures](https://daily.dev/tags/data-structures)

[View this post on daily.dev](https://daily.dev/posts/using-queues-and-stacks-in-python-with-its-collections-library-nqrnlfovm)
