AI engineering glossary · Data structures algorithms
What is circular buffer?
Circular buffer (also called ring buffer): A fixed-size queue stored in an array where the read and write positions wrap around to the start when they reach the end. It avoids shifting items and never reallocates, so it is common in streaming and logging.
Circular buffer: an example
A buffer holding the last 100 sensor readings overwrites the oldest reading when the 101st arrives, using one array and two moving indices.
Related terms
More Data structures algorithms terms
- Coin change problem
- Collision
- Comparison sort
- Connected components
- Consistent hashing
- Counting sort
- Cycle detection
- Data structure
Where you learn it
Circular buffer is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.