Rear = (Rear + 1)% MaxSize = 0 (Reached loc. There is one empty space at the beginning of a queue, which means that the front pointer is pointing to location 1. Let’s say the MaxSize of your queue is 5, and the rear pointer has already reached the end of a queue. Now you will understand how you can achieve circular incrementation, with the help of an example. The circular incrementation is achievable with the help of the modulo division. That is, when you reach the end of a queue, you start from the beginning of a queue. Additionally, this queue works by the process of circular incrementation. However, implementing a circular link is a new addition that you need to execute. You can implement the circular queue using both the 1-D array and the Linked list. Representation of Circular Queue using Arrays and a Linked List This operation takes place from the front of the Queue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |