deque data structure in the collections module.

EMBED

Tue Jun 18 2024 03:13:58 GMT+0000 (Coordinated Universal Time)

Saved by @pynerds #python


A deque is a type of queue that follows both FIFO(First-In-First-Out) and LIFO(Last-In-First-Out ) principles for insertions and retrievals. This means that elements can be inserted at or removed from either front or back of the structure. The collections module provides an efficient implementation of the deque structure.

https://www.pynerds.com/python-collections-deque/