Question: Need this code written in java language please and thank you. (a) Modify Algorithm 2, 3 & 4 so that they return in the value

 Need this code written in java language please and thank you.

Need this code written in java language please and thank you.

(a) Modify Algorithm 2, 3 & 4 so that they return in the value of the maximum subsequence and the starting and ending indices of the maximum subsequence. 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. Your program should measure (print) the execution time of these algorithms (Algorithm 2, 3 & 4) in nanoseconds. > java maxsumTest Please enter the size of the problem (N): 25 673 -869 -153 214 -139 40 65 -925 500 -639 -696 956 823 -714 967 Algorithm 2: MaxSum: 2532, Sindex: 10, E index: 14 Execution Time: 13 milliseconds Algorithm 3: MaxSum: 2532, Sindex: 10, E index: 14 Execution Time: 18 milliseconds Algorithm 4: MaxSum: 2532, S_index: 10, E_index: 14 Execution Time: 9 milliseconds

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 Databases Questions!