Hringrásaraðra
Hringrásaraðra, also known as a circular array or ring buffer, is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure is particularly useful for buffering data streams. When the buffer is full, new data is written into the oldest data, overwriting it.
The core idea of a hringrásaraðra is to manage a sequence of elements in a way that
When the write pointer reaches the end of the underlying array, it wraps around to the beginning.
Hringrásaraðra find common applications in areas such as operating system processes, where they can be used