Hands-On Data Structures and Algorithms with JavaScript
上QQ阅读APP看书,第一时间看更新

Types of queue

Before we begin understanding queues, let's quickly take a look at the types of queues that we may want to use in our applications:

  • Simple queue: In a simple FIFO queue, the order is retained and data leaves in the same order in which it comes in
  • Priority queue: A queue in which the elements are given a predefined priority
  • Circular queue: Similar to a simple queue, except that the back of the queue is followed by the front of the queue
  • Double ended queue (Dequeue): Similar to the simple queue but can add or remove elements from either the front or the back of the queue