QueueAr - package DataStructures QueueAr class CONSTRUCTION...

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

View Full Document Right Arrow Icon
package DataStructures; // QueueAr class // // CONSTRUCTION: with or without a capacity; default is 10 // // ******************PUBLIC OPERATIONS********************* // void enqueue( x ) --> Insert x // Object getFront( ) --> Return least recently inserted item // Object dequeue( ) --> Return and remove least recent item // boolean isEmpty( ) --> Return true if empty; else false // boolean isFull( ) --> Return true if capacity reached // void makeEmpty( ) --> Remove all items // ******************ERRORS******************************** // Overflow thrown for enqueue on full queue /** * Array-based implementation of the queue. * @author Mark Allen Weiss */ public class QueueAr { /** * Construct the queue. */ public QueueAr( ) { this( DEFAULT_CAPACITY ); } /** * Construct the queue. */ public QueueAr( int capacity ) { theArray = new Object[ capacity ]; makeEmpty( ); } /** * Test if the queue is logically empty. * @return true if empty, false otherwise.
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 04/22/2011 for the course CSC 532 taught by Professor Dr.gursaranadhar during the Spring '07 term at University of North Carolina Wilmington.

Page1 / 3

QueueAr - package DataStructures QueueAr class CONSTRUCTION...

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