Question: please do b ) Problems Description: Note that the maximum contiguous subsequence sum algorithms in the text do not give any indication of the actual

please do b)
Problems Description: Note that the maximum contiguous subsequence sum algorithms in the
text do not give any indication of the actual sequence. In this assignment, you will modify these
algorithms to return the maximum contiguous subsequence sum including the starting and
ending indexes of the sum. Also, your program will measure their execution times with various
input sizes.
(a) Modify Algorithms 2,3&4 so that they return in the value of the maximum subsequence
sum and the starting and ending indices of the maximum subsequence. Your algorithm will
return '0' if there is no positive number in the input array.
Your algorithm should take input size ( N ) from the user and generate a random sequence of
N integers ranging from -9999 to 9999. If N is less than 50, your program must print the
randomly generated numbers, and find the maximum subsequence independently (do not
refer the indexes found by other algorithms. Your program should measure (and print) the
execution time of these algorithms (Algorithms 2,3&4) in milliseconds or nanoseconds.
Sample Execution Scenarios >
Please enter the size of the problem (N): 15
673-869-153214-139
500967
Algorithm 2:
MaxSum: 2532, S_index: 10, E_index: 14
Execution Time: }82048\mathrm{ nanoseconds
Algorithm 3:
MaxSum: 2532, S_index: 10, E_index: 14
Execution Time: 23165 nanoseconds
Algorithm 4:
MaxSum: 2532, S_index: 10, E_index: 14
Execution Time: }11345\mathrm{ nanoseconds
Note: all three algorithms must be executed for the same input numbers >
(b) Measure and compare the executions times of your algorithms at least 10 times, and find
the average execution times of these algorithms. The execution time of each test case
must be recorded in a table. A template of the table for input size =8000 is shown below for
your reference. You have to add a similar table for each input size.
Plot the average execution times of Algorithm 2 & Algorithm 3 for input sizes
400,800,1600,3200,6400,12800, and 256000.
Plot the average execution times of Algorithm 3 & Algorithm 4 for input sizes 400,
800,1600,3200,6400,12800, and 25600.
(Note: Your graph must show the execution time on the vertical axis (Y axis) and
input size on the horizontal axis ( X axis)
(To generate a reasonable graph, please feel free to use different input sizes as needed)
please do b ) Problems Description: Note that the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!