A queue has certain characteristics


A queue has certain characteristics as listed below:

Head-The next item to exit the queue is always the head. 
Tail-The next item to enter the queue will always enter at the tail. 
Length of the queue-The number of items in the queue (between the head and tail). 
Capacity of the queue-The maximum number of items that the queue can hold. 
Position of each item-A queue can have any number of items between the head and tail, but each item has a position within the overall order. 

A queue can be implemented using a homogeneous array and a tail counter. The head of the array is always the first element of the array. Every time an item exits the queue, the other items are moved up. New items are always added to the end of the array. The capacity of the queue is equal to the capacity of the array. The tail counter specifies the location of the tail in the array.

Analyze the queue implementation previously specified for purposes of efficiency. Identify the conditions under which the implementation tends to deteriorate in efficiency. Suggest an improved implementation.  

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: A queue has certain characteristics
Reference No:- TGS095789

Expected delivery within 24 Hours