queues priorityqentry qlist priorityqueue (list "purple"purple "black"black "orange"orange "white"white "green"green "yellowfigure an instance of the priority queue implemented using list to evaluate the efficiencywe consider the implementation of each operation testing for an empty queue and determining the size can be done in ( time the enqueue operation requires linear time in the worst case since the underlying array may have to be reallocatedbut it has ( amortized cost the dequeue operation is also (nsince we must search through the entire list in the worst case to find the entry with the highest priority linked list implementation singly linked list structure with both head and tail references can also be used to implement the priority queue as illustrated in figure the queuenode class used in the implementation of the queue adt using linked list has to be modified to include the priority value after thatthe linked list can be used in similar fashion as the python list when an item is enqueuedthe new node is appended to the end of the linked list and when dequeue operation is performedthe linked list is searched to find the entry with the highest priority we leave the actual design and implementation as an exercise but examine the time-complexity of this approach priorityqueue qhead size qhead "purple "black "orange"orange "white"white "green "yellow"yellowfigure implementation of the priority queue from figure using linked list