representation of Queue

 The above figure shows the queue of characters forming the English word "HELLO". Since, No deletion is performed in the queue till now, therefore the value of front remains -1 . However, the value of rear increases by one every time an insertion is performed in the queue. After inserting an element into the queue shown in the above figure, the queue will look something like following. The value of rear will become 5 while the value of front remains same.


Array representation of Queue

After deleting an element, the value of front will increase from -1 to 0. however, the queue will look something like following.


Array representation of Queue

No comments:

Post a Comment