Queues - Queues 4/1/2003 8:53 AM Outline and Reading The...

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

View Full Document Right Arrow Icon
4/1/2003 8:53 AM Queues 1 Queues 4/1/2003 8:53 AM Queues 2 Outline and Reading The Queue ADT (§4.3.1) Implementation with a circular array (§4.3.2) Growable array-based queue Queue interface in C++ 4/1/2003 8:53 AM Queues 3 The Queue ADT The Queue ADT stores arbitrary objects Insertions and deletions follow the first-in first-out scheme Insertions are at the rear of the queue and removals are at the front of the queue Main queue operations: ± enqueue (Object o): inserts an element o at the end of the queue ± dequeue (): removes and returns the element at the front of the queue Auxiliary queue operations: ± front (): returns the element at the front without removing it ± size (): returns the number of elements stored ± isEmpty (): returns a Boolean indicating whether no elements are stored Exceptions ± Attempting the execution of dequeue or front on an empty queue throws an EmptyQueueException 4/1/2003 8:53 AM Queues 4 Applications of Queues Direct applications ± Waiting lists, bureaucracy
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 2

Queues - Queues 4/1/2003 8:53 AM Outline and Reading The...

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

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