Share to: share facebook share twitter share wa share telegram print page

Queue (abstract data type)

A queue

In Computer science, a queue is a dynamic data structure, used for storing items, before they are processed. A queue operates on a first-in, first-out FIFO principle, meaning the element that has been in the queue the longest is the next to be removed.

Generally, the following operations exist:

  • Enqueue: add the item to the back of the queue
  • Dequeue: remove the item at the front of the queue
  • Optionally, there may be an operation to look at the item at the front of the queue, without removing it.

Items that are between the first and the last element of the queue are not directly accessible.

There is a specialization, called priority queue: In a priority queue, each item also has a weight, which determine the position of the item in a queue.

Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya