Take particular care to note the pointers.ĭata is specified as being between the StartPtr and the EndPtrĪdding another element to the queue moves the EndPtr up oneĭeleting an element from the front of the queue is achieved by increasing the StartPtr by oneĪdding another element to the queue moves the EndPtr up one, it is now at the end of the bufferĪdding another element to the queue makes the EndPtr loop around to the free space at the beginning of the bufferĪdding another element to the queue moves the EndPtr up one, it is now closing in the on the StartPtrĪdding another element to the queue moves the EndPtr up one, it is now closing in the on the StartPtr. The following example shows a partially-full fixed length buffer and how it handles additions and deletions from a queue.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |