Due: Wednesday, February 24, 1999
Congratulations on your working program! Now that you have a reasonably working vector drawing program, your bosses have decided that you should look into seeing ways to improve the performance of the program. Towards this end, they wish for you to experiment with alternative data structures that may (or may not) speed up the program significantly.
Some people within the company have been walking through your code, and have recommended that you change the dynamic array structure you used to implement the PointArray into a linked list data structure. However, others say that its fine the way it is.
You (and, for that matter, the company CEO) are not sure about whether or not this is a good idea. So, you have also been asked to compare/contrast the execution times of both types of programs. In order to make the comparison as device independent as possible, big-O notation, where N is the number of elements in the array/list, should be used to analyze the run-time performance of each of the methods in the PointArray class.
We recommend that as a starting point you utilize the solution code we give for Homework 3. If you choose not to use our solution code, but instead use your own solution as a base, then you will want to download the following files:
They provide a new piece of functionality, namely, removing inidividual points from a polyline. This can be done while in point selection mode. Simply move your mouse to a point, click the right mouse button, and a menu will pop up, allowing you to delete the point.
The following two items are expected by the CEO for evaluation purposes:
Because this is a full fledged windows program, cin/cout/cerr will not work properly. You will have to rely on the debugger and assert statements to determine how your program behaves, if you need to do testing. You could also use fstreams to write debugging output to a temporary file, if you feel the need to do so. Alternatively, since the code you will be running will not involve writing windows code, you could test your code with testing programs in a console environment (like you've done in the past assignments) before trying to integrate the code back into the main system.
Also, remember that just because it happens to work within the framework provided by the interface doesn't mean that your code is correct. It is imperative on your part to test your code under a wide variety of conditions.