1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
swat32
3 years ago
11

Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr

oject DescriptionYou 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.
Computers and Technology
1 answer:
wolverine [178]3 years ago
7 0

Answer:

Check the explanation

Explanation:

#include<stdio.h>

/*Function to return max sum such that no two elements

are adjacent */

int FindMaxSum(int arr[], int n)

{

 int incl = arr[0];

 int excl = 0;

 int excl_new;

 int i;

 for (i = 1; i < n; i++)

 {

    /* current max excluding i */

    excl_new = (incl > excl)? incl: excl;

    /* current max including i */

    incl = excl + arr[i];

    excl = excl_new;

 }

  /* return max of incl and excl */

  return ((incl > excl)? incl : excl);

}

/* Driver program to test above function */

int main()

{

 int arr[] = {5, 5, 10, 100, 10, 5};

 printf("%d \n", FindMaxSum(arr, 6));

 getchar();

 return 0;

}

You might be interested in
Which arrangement shows the strongest gravitational effects of the sun and moon on the earth's tides?
julia-pushkina [17]
C rain tides is right
3 0
4 years ago
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
Romashka-Z-Leto [24]

I'm not 100% sure but I think it might be Microsoft excel.... correct me if I'm wrong

7 0
3 years ago
Read 2 more answers
How to change high school to primary school
poizon [28]

Answer:

If you are using Desktop then go to your profile and press the button that says edit profile. And then you will see button that says level.

The levels are

  • Middle School
  • Highschool &
  • College

Hope this helps❤❤❤

6 0
3 years ago
A computer on the network that requests resources or services from another computer on the network is known as:
Rudik [331]

Answer:

Client

Explanation:

In a client-server type of network, there is powerful central computer, called a server which hosts some information or data and other kinds of resources or programs. This server is connected to a number of less powerful computers, such as desktop computers and laptop which will access the data or resources from the server. These laptops and desktops are called clients.

6 0
3 years ago
A(n) ____ instruction might look like a meaningless string of 0s and 1s, but it actually represents specific operations and stor
Makovka662 [10]

Answer:

Option d is the correct answer.

Explanation:

Machine language is a language that is understood by any machine because it is made from the electric signal which has only two states on and off. On state refers to 1 and off-state refers to 1. The computer is also a type of machine so it can also understand machine language. The above question asked about the instruction which is made by 0's and 1's and it is used for the computers then the answer is Machine language which is described above and which is stated from the option d. Hence option d is the correct answer while the other is not because--

  • Option 'a' states about COBOL language which is an example of high-level-language, not the example of machine language.
  • Option b states about the programming language which is a mixture of all language of computers.
  • Option c states about ASCII which is not the correct answer.

7 0
4 years ago
Other questions:
  • A minor with prior convictions of Minor in Possession (MIP) who is charged with a subsequent MIP may be penalized with a jail se
    15·2 answers
  • What file holds the preferences and settings of the currently signed-in user??
    9·1 answer
  • Explain The Two Way Communication in full.
    10·1 answer
  • Assume that a is an array of two or more integers, and that b and c are integers.
    13·1 answer
  • In a fully underwritten offering a firm sells 1 million shares of stock through a fully underwritten offering. Their banker char
    10·1 answer
  • In Marvel Comics, what imaginary rare metal is an important natural resource of Wakanda, the home country of Black Panther?
    15·1 answer
  • A proposal is also known as a
    14·2 answers
  • Verbs in the active and passive voice
    14·1 answer
  • Leslie’s parents put a big dry-erase board on the refrigerator and let the kids write suggestions for how to organize and assign
    14·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!