data structures using howeverif we have new element with data and priority number then the element will be inserted after bas both these elements have the same priority but the insertions are done on fcfs basis as shown in fig figure priority queue after insertion of new node deletion deletion is very simple process in this case the first node of the list will be deleted and the data of that node will be processed first array representation of priority queue when arrays are used to implement priority queuethen separate queue for each priority number is maintained each of these queues will be implemented using circular arrays or circular queues every individual queue will have its own front and rear pointers we use two-dimensional array for this purpose where each queue will be allocated the same amount of space look at the two-dimensional representation of priority queue given below given the front and rear values of each queuethe two-dimensional matrix can be formed as shown in fig front[kand rear[kcontain the front and rear values of row kwhere is the priority number note that here we are assuming that the row and column indices start from not obviouslywhile programmingwe will not take such assumptions insertion to insert new element with priority front rear in the priority queueadd the element at the rear end of row kwhere is the row number as well as the priority number of that element for exampleif we have to insert an element with priority number then the priority queue will be given as shown in fig figure priority queue matrix front rear figure priority queue matrix after insertion of new element deletion to delete an elementwe find the first nonempty queue and then process the front element of the first non-empty queue in our priority queuethe first non-empty queue is the one with priority number and the front element is aso will be deleted and processed first in technical termsfind the element with the smallest ksuch that front[ !null programming example write program to implement priority queue #include #include #include struct node int dataint prioritystruct node *next