![]() ![]() Function to delete element from Circular Queue C++ program for insertion and deletion in Circular Queue // C or C++ program for insertion andĮlse if (front = -1) /* Insert First Element */ When the queue is not empty and both front and the rear pointer is pointing to the same index then assign front=-1 and rear=-1 Otherwise, if front = queue size-1 then front =0.We check if the queue contains any element.Otherwise ,we check if rear =queue size-1 then we assign rear =0 else rear =rear+1 and then we insert an element at rear position.If (rear=queue size-1 AND front=0) OR (rear=front-1) then the queue is completely filled and we can’t insert more elements in it.Check if the queue is completely filled or not.Dequeue: It is the process of deleting an element from the queue. ![]() Enqueue: inserting an element into the queue is called enqueue.Rear: The rear pointer points to the last element in the queue.Front: The first pointer points to the first element in the queue. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |