This makes circular buffers perfect solution for queues of some data streams, like video or audio. Both operations are done very effectively - in constant time O(1) and no reallocations are needed. They can both wrap around the size of the array. The Begin pointer is incremented whenever an item is popped from the front so that it "chases" the End pointer, which is incremented whenever a new item is pushed to the back. Functionality is implemented using two pointers or indices - pointing to the first and past the last valid element. It has limited capacity because it is based on preallocated array. Items can be added at the back and removed from the front. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.Ĭircular Buffer, Cyclic Buffer or Ring Buffer is a data structure that effectively manages a queue of some items. Warning! Some information on this page is older than 6 years now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |