Assignment (5)
CS3430 - Due Tue Feb 8, 9:59 pm

Preparations
Create a directory assgn5 under your 3460 directory and complete your work there. I will copy your files by 10:00 pm on the due date.

Put together all the 4 functions for the Max Subsequent Sum in one .cpp file. Measure the execution time of each algorithm for different input sizes. I will provide you 5 input files with different number of data points. You can find all the functions in this File.

Each input file contains an integer on its first line that says how many integers are in the sequence followed by the values for that sequence. Here is an example:
4
3 4 -2 5

How to measure the execution time of a segment of the code:
Make sure to have:
#include ctime at the top of your program.
Then declare:
long start_time, end_time;
Then in the body of the code, where you want to measure the time. Start the time before the segment you wish to measure, then stop the time. after.
Example:
start_time = (long int) clock();
  segment of the code you want to measure
  ....
end_time = (long int) clock();
Then display the difference between the end_time and the start_time as how long it took for that segment to run.
You can repeat this as many times as you wish for different segments.
I will copy your programs to grade, but you need to submit a table that identify each algorithms and the running time for each input as well.

You may need to include the vector.h file in your program and compile your program with vector.cpp you can create these two files by cutting and pasting using the links given here. The input files are:  inp100, inp200, inp400, inp500, and inp1000.
 
Your table may look like this:

Elapsed time results of the analysis of 4 Max Subsequent Sum
Number Data/Algorithm
Algorithm (1)
Algorithm (2) Algorithm (3) Algorithm (4)
100 - Max Sum =




500 - Max Sum =



1000 - Max Sum =

1500 - Max Sum =



2000 - Max Sum =