Assignment #7, COP-3337
This assignment requires that you write
three separate implementations of a queue
and then compare the performance.
Simplifications
For all implementations, you do not need to provide
operator=.
You must also remove the part of the textbook code that deals
with inheritance, as I did in class for the stack.
The Three Versions
The three versions are as follows:
Version #1
Use bare pointers, as is done in the text.
Make sure that you explictly disable the copy constructor.
Version #2
Use a Vector instead of the bare pointer.
The copy constructor is automatically disabled (why?).
Version #3
Use the linked list version, as is done in the text.
Make sure that you explictly disable the copy constructor.
Testing Speed
Test how long it takes to do each of the following for
each queue version:
- Enqueue and dequeue 1000000 int; specifically,
enqueue 0, 1, 2, ..., 999999.
Do something like:
for( int i = 0; i < 1000000; i++ )
Q.Enqueue( i );
while( !Q.IsEmpty( ) )
Q.Dequeue( );
What to Submit
Submit all source code attached to a report that
summarizes the performance of the three implementations.
The simplest way to do this is to give the three queue implementations
different names, instantiate a total of three queues (each queue for
int), and then output
the result of running the profiler.
This is discussed in Section 1.6.
You must give two reports.
One report compiles the program without optimization.
The other uses -O4.
Special Rules
The rules below may seem harsh now, but they are necessary
so that you can grow as computer science majors.
The field is rapidly changing and an important skill is to
be able to pick up new concepts quickly.
-
The fact that I have not discussed queues is irrelevant.
As a computer science major, you will have to be able to reuse
already provided code.
There are no algorithmic changes needed to get the queues to work.
You may start by downloading the queue code from the class page.
Please do not ask me for help understanding how a queue works.
-
The fact that I have not discussed prof is irrelevant.
You'll need to figure this out on your own
(but I think Section 1.6 is clear).
And it is a big part of the assignment.
Please do not ask me for help understanding how to use prof.
-
You may not in any way, shape, or form, change the specifications
of this assignment.
It must run on serss1.
Please do not ask me for any exceptions to this rule.
-
You must give me a professional submission: once again, I ask that
your code be properly indented and formatted, using good style,
that it be in one unit, stapled or bound as needed, and that you include all
information that you feel will support your case for a high grade.
Please keep in mind that the first thing the grader sees will
influence how your project is graded.
If the papers are torn or scattered, if the code looks bad
to start with, if
output is missing, incomplete, or
hard to find,
then the grader will not be inclined to give you
the benefit of any doubts.
That's just the way it is!