![]() But in the case of a priority queue, the element which is having highest priority will be dequeued first. In the queue, the element inserted first will be dequeued first.The main difference between a queue and a priority queue: We can also set priorities according to our demand. For example, the element with bigger value will have a higher priority than the element with lower value. Usually, an element’s value is considered for assigning the priority. How is the Priority Value assigned in the Priority Queue? The priority queue is widely used in many applications like job scheduling algorithms, CPU and Disk scheduling, and managing various resources shared between different processes, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |