The definition of head, tail, their movement direction and write and read location are all implementation dependent but the idea/goal remains the same. As data is added (write) to the buffer, the head pointer is incremented and likewise, when the data is being removed (read) the tail pointer is incremented. This is achieved by two pointers to the array, the “head” pointer and the “tail” pointer. What is a circular buffer?Ĭircular buffer is a FIFO data structure that treats memory to be circular that is, the read/write indices loop back to 0 after it reaches the buffer length. Hopefully, this will allow you to make informed decisions on the choice of data structure. In this section we will go over some of the key aspects and problems of a circular buffer implementation. Choice of a good data structure or algorithm for a given problem comes after a deep understanding of the underlying theory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |