teach-ict.com logo

THE education site for computer science and ICT

2. Queues

A queue is a form of linked list data structure.

It contains several data items, with each item pointing to the one in front of it. The very front and back of the queue are marked by pointers, called the 'head' (for the front) and the 'tail' (for the back). Like this:

Just like with linked lists, you can add items to a queue while a program is running.

The difference is that any item in a linked list can be accessed. With a queue, you can only access the items at the head and the tail.

 

A queue is a linked list but only the item at the front (head) or back (tail) of the list can be accessed.

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: What is a queue data structure