Tagged articles
deque
11 articles · Page 1 of 1
This article explains how the C++ deque combines the random‑access speed of a vector with the constant‑time double‑ended insertions of a list by using a segmented storage architecture, detailing its internal map, iterator mechanics, core operations, performance comparisons, practical use cases, and common pitfalls.
AlgorithmC++data structure
0 likes · 47 min read

Python developers often create simple queues with lists using append and pop(0), but this approach has O(n) complexity and thread‑safety issues; the article explains how the built‑in queue module provides efficient, thread‑safe FIFO, LIFO, and priority queues, with code examples for single‑thread and multithreaded task processing.
MultithreadingProducer-ConsumerPython
0 likes · 5 min read

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.
AlgorithmListPython
0 likes · 7 min read

This article walks through implementing a greenhouse automatic control system in Python, using a deque to store temperature‑humidity readings, defining a GreenhouseControlSystem class with methods for adding data, checking thresholds, and simulating the process, and explains the design choices.
OOPPythonSimulation
0 likes · 5 min read

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.
ChainMapCounterHeapq
0 likes · 6 min read

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.
AlgorithmC++Java
0 likes · 9 min read

This article introduces Python’s collections module as a versatile alternative to built‑in containers, detailing the purpose, key methods, and practical code examples for Counter, defaultdict, OrderedDict, namedtuple, deque, and ChainMap, helping developers choose the right specialized container for their tasks.
ChainMapCounterPython
0 likes · 11 min read

This article introduces Python's collections module, explaining the purpose and usage of its specialized container types—including Counter, defaultdict, OrderedDict, namedtuple, deque, and ChainMap—along with their most common methods and practical code examples.
ChainMapCounterNamedtuple
0 likes · 10 min read

This article explains how to compute the maximum of each k‑sized sliding window over an integer array using both a priority‑queue (heap) approach and an optimized monotonic deque technique, complete with detailed walkthroughs, visual illustrations, and full Python code.
AlgorithmHeapdeque
0 likes · 9 min read

This article provides a thorough, English‑language overview of Java's Queue hierarchy, detailing the 18 concrete queue classes, their inheritance relationships, core methods, blocking variants, deque and transfer semantics, and practical code examples for each implementation.
BlockingQueueConcurrencyJava
0 likes · 27 min read

This article provides a comprehensive overview of Python’s collections module, detailing its specialized container types such as Counter, defaultdict, OrderedDict, namedtuple, deque, and ChainMap, along with usage examples and key methods for each.
ChainMapCounterPython
0 likes · 11 min read
