![]() The drawback that occurs in a linear queue is overcome by using the circular queue. The representation of circular queue is shown in the below image. ![]() It is also known as Ring Buffer, as all the ends are connected to another end. It is similar to the linear Queue except that the last element of the queue is connected to the first element. In Circular Queue, all the nodes are represented as circular. ![]() To know more about the queue in data structure, you can click the link - Circular Queue In this case, the linear Queue shows the overflow condition as the rear is pointing to the last element of the Queue. If the first three elements are deleted from the Queue, we cannot insert more elements even though the space is available in a Linear Queue. The major drawback of using a linear Queue is that insertion is done only from the rear end. The end at which the insertion takes place is known as the rear end, and the end at which the deletion takes place is known as front end. In Linear Queue, an insertion takes place from one end while the deletion occurs from another end. There are four different types of queue that are listed as follows. Now, let's move towards the types of queue. The representation of the queue is shown in the below image. Similar approach is followed in the queue in data structure. The real-world example of a queue is the ticket queue outside a cinema hall, where the person who enters first in the queue gets the ticket first, and the last person enters in the queue gets the ticket at last. Queue can also be defined as the list or collection in which the insertion is done from one end known as the rear end or the tail of the queue, whereas the deletion is done from another end known as the front end or the head of the queue. A queue is a data structure in which whatever comes first will go out first, and it follows the FIFO (First-In-First-Out) policy. Queue is the data structure that is similar to the queue in the real world. ![]() But before moving towards the types, we should first discuss the brief introduction of the queue. In this article, we will discuss the types of queue. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |