queues 9 - The Queue ADT What is a Queue? A Queue is a type...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
The Queue ADT
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Queue ADT 2 What is a Queue? A Queue is a type of collection where data is accessed in a FIFO or LILO manner. FIFO = First In First Out LILO = Last In Last Out Some applications of a queue: Process queues Printer job queues Assembly line processing Any kind of simulation
Background image of page 2
The Queue ADT 3 Specifying Queue ADT Behavior What operations are associated with a queue? Create an empty queue Destroy a queue Determine whether a queue is empty Determine the number of items in a queue Insert an item into the end of the queue Retrieve an item from the front of the queue Remove an item from the front of the queue Display the contents of the queue These operations specify an interface to a Queue ADT, regardless of which implementation we will choose.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 The Queue Interface class Queue { public: // Create and Destroy Queue(); ~Queue(); // Insert, Retrieve, and Remove void insert(const QueueItemType& item); const QueueItemType& front() const; const QueueItemType& remove();
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/17/2010 for the course CS 162 taught by Professor Fant during the Spring '08 term at Portland State.

Page1 / 10

queues 9 - The Queue ADT What is a Queue? A Queue is a type...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online