Queue

In computer science, a priority queue is an abstract data type similar to a regular queue or stack data structure in which each element additionally has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. In some implementations, if two elements have the same priority, they are served according to the order in which they were enqueued, while in other implementations, ordering of elements with the same priority is undefined.
While priority queues are often implemented with heaps, they are conceptually distinct from heaps. A priority queue is a concept like "a list" or "a map"; just as a list can be implemented with a linked list or an array, a priority queue can be implemented with a heap or a variety of other methods such as an unordered array.

View More On Wikipedia.org
  • 29

    Greg Bernhardt

    A PF Singularity From USA
    • Messages
      19,448
    • Media
      227
    • Reaction score
      10,036
    • Points
      1,237
  • 1

    Osmium

    A PF Quark
    • Messages
      1
    • Reaction score
      0
    • Points
      1
  • 1

    gruba

    A PF Electron
    • Messages
      206
    • Reaction score
      1
    • Points
      16
  • 1

    JessicaHelena

    A PF Electron
    • Messages
      188
    • Reaction score
      3
    • Points
      23
  • Back
    Top