hw04 - CS2134 Fall 2009 Profs Frankl and Hellerstein...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 CS2134 Fall 2009 Profs Frankl and Hellerstein Homework #4 Due Tuesday Nov 3, 11:59p.m. Programming Part In this assignment you will modify a static array implementation of the queue, adding several additional methods. The posted files provide a modified version of the textbook's array queue implementation. These are MODIFIED versions of: http://users.cs.fiu.edu/~weiss/adspc++2/code/QueAr.h http://users.cs.fiu.edu/~weiss/adspc++2/code/QueAr.cpp (and unmodified) http://users.cs.fiu.edu/~weiss/adspc++2/code/Except.h The textbook's implementation was modified so that it stores the elements in a FIXED sized vector, rather than re-sizing the v e A data member stores the capacity and a parameter to the constructor is used to initialize the capacity. For example, Queue q(10) creates a queue that can store up to 10 elements. The enqueue method was changed so that it throws an exception if there is an attempt to add an element to a queue that has Some other methods were changed to use the capacity data member rather than calling vector::size() to find out the capacity. Modify the Queue class by adding the following member functions. Prototypes are provided in file QueueAr.h: 2. void print(string delim)const // outputs objects in queue to cout, separated by delimiter // Adds elements of q to the end of this queue, in order, without modifying q. // If there is not enough space, throws exception and does not
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 / 8

hw04 - CS2134 Fall 2009 Profs Frankl and Hellerstein...

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