Computer Science, asked by Roshnu, 11 months ago

importance of priority queue using linked list

Answers

Answered by BrainlyFIRE
0
A priority queue is a very important data structure because it can store data in a very practical way. This is a concept of storing the item with its priority. This way we can prioritize our concept of a queue

In the Code below there are four parts. First three function to implement three different operations like Insert a node, delete a node and display the list. The Fourth part is the main function, in that a do while loop is implemented to keep the user engaged and provide him the all the given choices, according to the choice one of the three function get called.

The First function creates a new node and then checks whether the queue is empty or not. If the queue is empty it adds the node at the first place, else it reaches to the last position and adds the item there.

The Second function checks whether the list is empty, or it is not. If any node exists, it will delete the node.

The Third function will simply print all the elements of the Queue if exist. If not, then it will say Queue is Empty.


Roshnu: not so good
Roshnu: i mean not right answer
Similar questions