Home > IB Computer Science 2017 > Higher Level: Queues

Higher Level: Queues

September 22, 2015 Leave a comment Go to comments

Unlike a stack, a queue is a FIFO data structure (first in, first out). This should be intuitive to you. After all, if you join the queue first, you expect to get served first.

Like a stack it can implemented statically, using an array, or dynamically, using a linked list.

Your task is to think about how you would implement a queue in both of these situations. There are problems with both the static and the dynamic method.

  • What is the problem when you use an array? How can you solve it?
  • What is the problem when you use a linked list? What is the solution?
  • What are queues used for in computer systems? Document two examples on your website.
  • Make sure you also have two uses for stacks.
  • Implement a queue using java.util.LinkedList
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s