3 Years
Discussion Span
Last Post by Schol-R-LEA

As Rubberman says, you need to do the actual work; we can only advise you and help you fix problems. That having been said, I will give you this advice:

A Queue is a specialized for of collection in which the order that items are added is the same as the order they get removed. It is also called a FIFO (first in, first out) list. They can be easily implemented as either an array (for a fixed-size queue) or a list. The assignment probably assumes a list implementation, but if there is a limit to the size, you would be better off using an array.

Basically, the Queue is a list with both a pointer to the first item and a pointer to the last item. When you add an item, you add it to the head; when you remove an item, you remove it from the tail. You need to make sure that the tail pointer is updated when an item is removed, but other than that, it is a very easy data structure to implement if you already know how to write a linked list.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.