Description
P4 reinforces understanding of the heap data structure and dynamic memory.
Submitted programs must:
1) provide the requested functionality
2) be appropriately documented (thorough but concise)
3) use C++ constructs as intended
4) defines copy semantics!!
ALL ASSUMPTIONS SHOULD BE REASONABLE AND CLEARLY STATED
DO NOT HARD CODE
YOU MAY NOT USE THE STL
Write a C++ program that:
1) defines a bizarreQ type (class) that is a priority queue for integers that:
supports the standard Q operations
orders items by priority
uses an internal heap data structure
PLUS:
supports the ability to ‘flush’ all odd numbers
internally resizes when capacity is exceeded
2) tests an instance of this bizarreQ type on integer data
a. use a random number generator in your driver
b. enqueue enough items to exceed initial capacity
c. exercise all functionality (enqueue, dequeue, flush,…)
3) dequeued items from the bizarreQ object to be sent to output file P4Output.txt
TEST YOUR PROGRAM BEFORE SUBMISSION
Name your C++ files: bizarreQ.h, bizarreQ.cpp, P4.cpp
Submit these files as well as input and output files to Canvas and cs1