What is Priority Queue?

Technology CommunityCategory: Data StructuresWhat is Priority Queue?
VietMX Staff asked 3 years ago

priority queue is a data structure that stores priorities (comparable values) and perhaps associated information. A priority queue is different from a “normal” queue, because instead of being a “first-in-first-out” data structure, values come out in order by priority. Think of a priority queue as a kind of bag that holds priorities. You can put one in, and you can take out the current highest priority.

 

priority-queue