answersLogoWhite

0


Best Answer

A linear queue is a FIFO structure (first in, first out) akin to a queue of people waiting in line to be served on a first-come, first-served basis. There are no disadvantages provided you use it for the purpose intended.

You probably meant to ask what are the disadvantages of implementing a queue using a linear list. A linear list is a LIFO structure (last in, first out), which is akin to a stack of plates. The last plate on the stack is the first to be removed from the stack. In order to transform a linear list into a queue we must modify the behaviour slightly.

A linear list is typically implemented using a forward list (a singly-linked list) where every node points to the next node. Insertions and extractions always occur at the head node since the head node is the only node maintained by the list, and is therefore the only node with constant-time access. To locate the tail node, we must recursively traverse from the head node through each node's next node, until there is no next node. This traversal has linear complexity; the time taken to locate the tail node is directly proportionate to the number of nodes. Thus for a list of n nodes, it will take O(n) time to locate the tail node, but O(1) time to locate the head node.

To turn a linear list into a queue we must maintain a secondary pointer to the tail node. Extractions will still occur at the head but now insertions will occur at the tail. While this resolves the immediate problem, we're now using additional memory simply to maintain the tail pointer. Although the additional memory is minimal, there is a better way. If we point the tail node at the head node we create a circular list. This then means we can access both the head and tail nodes in constant-time through the tail node alone. Thus we no longer need to maintain a pointer to the head node.

To summarise, linear lists are disadvantageous when implementing queues because of the need to maintain two node pointers to achieve constant-time access to the head and tail nodes. Circular lists resolve the problem by utilising just one pointer to the tail.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

What are the advantage & Disadvantage of Linear Queue

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

any one upload dis advantages of linear queue

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

In a multi-threaded environment, a circular queue might cause an infinite loop, impairing processing. Also, coding a circular queue is considerably more complex than a linear one.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Queue can be implemented only as a linked list.

This answer is:
User Avatar

User Avatar

rahul goswami

Lvl 2
3y ago

harder to implement than linear queue,but once you understand the concept it utilizes memory in a very much better way than linear queue.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

difficult to write code

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

shuuhh

This answer is:
User Avatar

User Avatar

suhayb yare

Lvl 2
3y ago

Management

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

When any element is inserted in linear queue then rear will be increased by 1. Let, assume after insertion operations rear is shifted to last position in queue. It means, now queue is full. Now if a new element is inserted then overflow condition will occur.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the disadvantage of circular queue?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between linear and circular queue?

What is the difference between linear and circular queue? In: http://wiki.answers.com/Q/FAQ/2545-37 [Edit categories]The Queue by Default is Linear, it would be termed as Circular if the Last Element of the Queue pointsto the first element of the List


How compiler differentiate between linear queue and circular queue?

It doesn't.


Difference between simple queue and circular queue?

Simple queue is a linear queue having front & rear var to insert & delete elements from the list.But there is a boundary that we have to insert at rear & have delete from front.For this reason instead of having space in the queue if there is a single element in the rear,the queue is full.the other space is wasted.To utilize space properly,circular queue is derived.In this queue the elements are inserted in circular manner.So that no space is wasted at all.


Circular queue in linear data structure?

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer.


What is the definition of circular queue?

A queue is simply a FIFO i.e first in first out. In queue we've front and rear. Front is the initial or first location of the queue whereas rear indicates the last entry location in the queue. In the circular queue the location of front and rear will be the same IF the total space of the circular queue is utilized. Each element has its position no. for insertion , if we set the 5th element as the front element then after every insertion the ptr indicates the 5th element as front. in deletion, the fifth element is deleted every time it is the rear position. after deletion of an element the queue rotates and every time the rear indicates the 5th element of the circular queue. and every time the 5th location element is deleted.

Related questions

Circular queue program?

For the Complete Implementation of Circular Queue Check out www.codeuniverse.tk


Which queue most efficient queue using array?

circular queue


Difference between circular queue and linear queue?

In circular queue the memory of the deleted process can be used by some other new process..


What is circular queue operations circular queue?

A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer. There are 2 conditions for queue full if queue is implemented using arrays. First condition is Front = 1 and Rear = N Second condition is Front = Rear + 1


What is the difference between linear and circular queue?

What is the difference between linear and circular queue? In: http://wiki.answers.com/Q/FAQ/2545-37 [Edit categories]The Queue by Default is Linear, it would be termed as Circular if the Last Element of the Queue pointsto the first element of the List


Define is circular queue with example?

A circular queue uses the same conventions as that of linear queue. Using Front will always point one position counterclockwise from the first element in the queue.


How compiler differentiate between linear queue and circular queue?

It doesn't.


What is the difference between a priority queue and a circular queue?

A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. A priority queue is a queue in which each element is inserted or deleted on the basis of their priority. A higher priority element is added first before any lower priority element. If in case priority of two element is same then they are added to the queue on FCFS basis (first come first serve).


What is the need of circular queue in data structures?

Circular queue is a linear data structure that follows the First In First Out principle. A re-buffering problem often occurs for each dequeue operation in a standard queue data structure. This is solved by using a circular queue which joins the front and rear ends of a queue.


List out atleast 5 rela life instances where queue and circular queue operations are being used?

1. List out atleast 5 rela life instances where queue and circular queue operations are being used.


What is circular queues Explain in detail along with example?

circular queue


What are types of Queue?

Queue is a data structure which is based on FIFO that is first in first out. Following are the types of queue: Linear queue Circular queue Priority queue Double ended queue ( or deque )