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
How do you innovate or improve a product?
In-s [12.5K]

Answer:in order to innovate or improve a product you need to have an idea

Explanation:

5 0
3 years ago
What is movie viewer, such as quicktime windows media player,an example of
Karo-lina-s [1.5K]
It is called the Databse
5 0
3 years ago
Function of network security​
myrzilka [38]

Answer:ffffffffffffgggggg

Explanation:vvvc

5 0
4 years ago
Which of the following is a way to sell the network proposal to management?Group of answer choicestalk about upgrades from 10Mbp
Assoli18 [71]
Ethernet is the best in reliability and speed
5 0
3 years ago
Another method that might be desired is one that updates the Student's number of credit hours. This method will receive a number
statuscvo [17]

Answer:

Option d is the method

Explanation:

public void update Hours(int more Hours)

{

hours += more Hours;}e. public int update Hours(int more Hours){return hours + more Hours;

}

5 0
3 years ago
Other questions:
  • WILL DO A BRAINLY! help pls.
    15·1 answer
  • HELP ASAP!!! 100 POINTS
    9·2 answers
  • Which osi/iso layer is responsible for determining the best route for data to be transferred?
    5·1 answer
  • Andrew’s Complete Cameras offers its customers an interactive website to help them choose the best camera for their lifestyle. B
    8·1 answer
  • If two egg cells are fertilized what will happen?
    10·1 answer
  • Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
    7·1 answer
  • When installing the latest version of Internet Explorer, a dialogue box pops up with a box checked telling you that Bing will be
    15·1 answer
  • Identify what algorithm or concept the following code relates to. void Sort(int array[], int tempArray[], int left, int right) {
    6·1 answer
  • What is an automatic update and when should you use it
    10·1 answer
  • you need to configure a wireless network using wpa2-enterprise. which of the following components should be part of your design?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!