lab7 - CSS 342: Mathematical Principles of Computing Lab 7:...

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

View Full Document Right Arrow Icon
CSS 342: Mathematical Principles of Computing Lab 7: Queues - Deque Professor: Munehiro Fukuda Assigned: See Our Syllabus Purpose This laboratory work implements a Deque class that allows a data item to be enqueued to and dequeue from both the back and front. Deque Deque is an abbreviation for a "double ended queue". It allows a new data item to be enqueued not only to the back but also to the front. Similarly, it allows both the front and the back item to be retrieved and dequeued. The following code shows a header file of this Deque class: #ifndef DEQUE_H #define DEQUE_H #include <iostream> using namespace std; template <class Object> class Deque { public: Deque( ); // the constructor Deque( const Deque &rhs ); // the copy constructor ~Deque( ); // the destructor bool isEmpty( ) const; // checks if a deque is empty. int size( ) const; // retrieves # deque nodes const Object ≥tFront( ) const; // retrieve the front node const Object ≥tBack( ) const; // retrieve the tail node void clear( );
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.

Page1 / 3

lab7 - CSS 342: Mathematical Principles of Computing Lab 7:...

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