Tag

deque

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Mar 1, 2025 · Fundamentals

Why Python’s deque Beats Lists for Fast Insertions: A Practical Guide

This article explains why Python lists are slow for head insertions and deletions, introduces the deque data structure from the collections module, compares their time complexities, and shows practical scenarios and code examples where deque provides superior performance and thread‑safety.

Data StructuresPythonalgorithm
0 likes · 7 min read
Why Python’s deque Beats Lists for Fast Insertions: A Practical Guide
Test Development Learning Exchange
Test Development Learning Exchange
Jun 26, 2024 · Fundamentals

Python collections module: Counter, defaultdict, deque, namedtuple, ChainMap, custom containers, heapq, and LRU cache examples

This article introduces several useful classes from Python's collections module—including Counter, defaultdict, deque, namedtuple, ChainMap, UserList/UserDict/UserString, as well as heapq and an OrderedDict‑based LRU cache—explaining their purposes and providing ready‑to‑run code examples for each.

ChainMapCollectionsNamedtuple
0 likes · 6 min read
Python collections module: Counter, defaultdict, deque, namedtuple, ChainMap, custom containers, heapq, and LRU cache examples
IT Services Circle
IT Services Circle
Apr 5, 2024 · Fundamentals

Huawei OD Interview Algorithm Problem – Basketball Game (Deque Simulation)

The article presents a Huawei OD interview problem where numbered basketballs are inserted into a linear bucket and can be removed from either end, describes the input and output formats, provides a simulation-based solution using double‑ended queues, and includes reference implementations in C++ and Java.

C++InterviewJava
0 likes · 9 min read
Huawei OD Interview Algorithm Problem – Basketball Game (Deque Simulation)