| Task: |
- Modify the class BubbleSort from Project No. 1 such that it sorts STL
vectors as opposed to standard arrays.
- Further modify BubbleSort by adding a counter variable,
and appropriate increment steps, in order to count the number of comparisons
made to sort each vector. Bubblesort::Sort() should return the number of
comparisons for a given sort.
- Write and execute a C++ program based on your new design that tests
your method on four vectors of length 10, 100, 1000, and 10000, respectively.
- Print a screen capture of the end of each execution, showing a succesful
sort, the number of elements sorted, and the comparison count for that sort.
- Submit copies of your handwritten design (algorithm), printouts
of all modified source code files, a printout of your screen capture,
and an executable version of your program on disk.
|