Implementing the queue with a fixed size array

  • We can implement a queue with an array and 2 indexes head and tail:

    where:

    • head = the location of the front (first position) of the queue

    • tail = the location of the open spot at the tail (last position) of the queue