#ring-buffer
Wiki
›
Algorithms
›
02. Data Structures
›
1. Core Data Structures and Operations
›
1.1 Arrays and Dynamic Arrays
›
Circular Array
Circular Array A circular array treats a fixed-size array as if it wraps around. Indices advance modulo the capacity, so the structure forms a logical ring. You use it when you need constant-time insertions and removals at both ends within a bounded buffer. Problem Maintain a sequence $A$ of capacity $n$ that supports: insert at front and back remove from front and back wrap indices without shifting elements Structure A...