subject
Engineering, 29.06.2021 01:00 hannahmyung1113

You will analyze three algorithms to solve the maximum contiguous subsequence sum problem, and then evaluate the performance of instructor-supplied implementations of those three algorithms. You will compare your theoretical results to your actual results in a written report. What is the maximum contiguous subsequence sum problem?Given a sequence of integers A1, A2, ..., An (where the integers may be positive or negative), find a subsequence Aj, ... , Ak that has the maximum value of all possible subsequences. The maximum contiguous subsequence sum is defined to be zero if all of the integers in the sequence are negative. Consider the sequence shown below. A1: -2 A2: 11 A3: -4 A4: 13 A5: -5 A6: 2The maximum contiguous subsequence sum is 20, representing the contiguous subsequence in positions 2, 3 and 4. The sum of the values in all other contiguous subsequences is less than or equal to 20.Consider a second sequence, shown below. A1: 1 A2: -3 A3: 4 A4: -2 A5: -1 A6: 6The maximum contiguous subsequence sum is 7, representing the contiguous subsequence in positions 3, 4, 5 and 6.Four different algorithms have been developed to solve this problem, you can download them below. You will:1. Analyze each of the three algorithms in source code form. To analyze an algorithm, you will review the C++ source code, then give the upper bound (in "Big-Oh" notation) on the execution time of the algorithm and briefly explain your reasoning.2. Compile and run the program to evaluate the performance of the three functions. To evaluate the performance of an algorithm on a computer, you will call the functions in a driver (such as the one we supplied: project08driver. cpp ) and execute the program. The driver can call these three functions with different prototypes shown below. int Max_Subsequence_Sum_BLUE ( const int [], const unsigned int ); int Max_Subsequence_Sum_GREEN( const int [], const unsigned int ); int Max_Subsequence_Sum_RED ( const int [], const unsigned int );To evaluate a function, you will execute the program which uses that function for each of the following input sequence sizes: N = 64, 128, 256, 512, 1024, 20483. Write a report comparing your theoretical and actual results from 1. and 2. In your report, include the times of all test cases for each combination of N and function (COLOR).Your report will contain the following sections (in the order stated): a) analysis of Algorithm #1 (contained in "project08algorithm1.cpp"-- this is Blue function) b) analysis of Algorithm #2 (contained in "project08algorithm2.cpp"-- this is Green function) c) analysis of Algorithm #3 (contained in "project08algorithm3.cpp"-- this is Red function) d) the name and specification of the computer such as the Operating System, Processor, Memory. e) actual running times for function BLUE f) actual running times for function GREEN g) actual running times for function RED h) a statement about which algorithms from a) through c) are implemented by which functions (e) through (g), and conclusions about your theoretical and actual results In sections (e) through (g), be sure to include the maximum contiguous subsequence sum for each array size to demonstrate that the computations are correct. algorithm 1- // Algorithm #1 //project08algorithm1.cppint Max_Subsequence_Sum( const int A[], const int N ){ int This_Sum = 0, Max_Sum = 0; for (int i=0; i Max_Sum) { Max_Sum = This_Sum; } } } return Max_Sum;}// Algorithm #2 //project08algorithm2.cppint Max_Subsequence_Sum( const int A[], const int N ){ int This_Sum = 0, Max_Sum = 0; for (int i=0; i Max_Sum) { Max_Sum = This_Sum; } } } return Max_Sum;}// Algorithm #3 //project08algorithm3.cppint Max_Subsequence_Sum( const int A[], const int N ){ int This_Sum = 0, Max_Sum = 0; for (int Seq_End=0; Seq_End Max_Sum) { Max_Sum = This_Sum; } else if (This_Sum < 0) { This_Sum = 0; } } return Max_Sum;}Sample driver-#include #include #include #include #include "timer. h"using namespace std;int Max_Subsequence_Sum_BLUE( const int A[], const int N ){ int This_Sum = 0, Max_Sum = 0; for (int i=0; i Max_Sum) { Max_Sum = This_Sum; } } } return Max_Sum;}int main( ){ int Size = 64; int *Vec, Result[6]; char Answer; Timer T[6]; for ( int i = 0; i < 6; i++) { Vec = new int [Size]; srand( time(0) ); for (int I=0; I> Answer; if (Answer == 'Y' || Answer == 'y') { for (int J=0; J

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Two flowing streams of argon gas are adiabatically mixed to form a single flow/stream. one stream is 1.5 kg/s at 400 kpa and 200 c while the second stream is 2kg/s at 500 kpa and 100 ? . it is stated that the exit state of the mixed single flow of argon gas is 150 c and 300 kpa. assuming there is no work output or input during the mixing process, does this process violate either the first or the second law or both? explain and state all your assumptions.
Answers: 1
question
Engineering, 04.07.2019 18:10
Aflywheel accelerates for 5 seconds at 2 rad/s2 from a speed of 20 rpm. determine the total number of revolutions of the flywheel during the period of its acceleration. a.5.65 b.8.43 c. 723 d.6.86
Answers: 2
question
Engineering, 04.07.2019 18:10
At 12 noon, the count in a bacteria culture was 400; at 4: 00 pm the count was 1200 let p(t) denote the bacteria cou population growth law. find: (a) an expression for the bacteria count at any time t (b) the bacteria count at 10 am. (c) the time required for the bacteria count to reach 1800.
Answers: 1
question
Engineering, 04.07.2019 18:10
Ahot wire operates at a temperature of 200°c while the air temperature is 20°c. the hot wire element is a tungsten wire of 5 um diameter and 2 mm in length. plot using excel current, heat transfer and heat generated by the wire for air velocity varying from 1-10 m/s in steps of lm/s? matlab the sensor voltage output, resistance, or assume nu 0.989 re033pr13 take air properties at tr (200°c20°c)/2 = 110°c properties of tungsten: c 0.13 kj/kg.k 3 p 19250 kg/m k (thermal conductivity) = 174 w/m.k
Answers: 2
You know the right answer?
You will analyze three algorithms to solve the maximum contiguous subsequence sum problem, and then...
Questions
question
Mathematics, 19.08.2019 05:30
question
English, 19.08.2019 05:30
question
Mathematics, 19.08.2019 05:30
Questions on the website: 13722359