Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
(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 millisecondsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started