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
Help pleaseeeeeeeeeeeee
viktelen [127]
By dragging its borders
7 0
3 years ago
Read 2 more answers
Who Is faster sonic or flash well it all depends on which version of sonic your talking about like for example video game sonic,
zhuklara [117]

Answer:

Flash.

Explanation:

If a computer software could make sonic run even close to the speeds of flash, the software would not be able to handle it.

-Mr. Willams

6 0
3 years ago
What are the advantages of Napier bones?​
Alja [10]

Answer:

portability and simplicaity are the featues of napier bones

8 0
3 years ago
Use the modulo operator (%) to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which
uranmaximum [27]

Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Python, and you can apply a similar method for any programming language.

Answer:

def rightMost(num):

   lenNum = len(str(num))

   rightNum = num%(10**(lenNum-1))

   print(rightNum)

   return(rightNum)

Explanation:

In this function we receive an integer number, then we find how many digits this number has, and finally, we find the rightmost digits; the main operation is modulo (takes the remainder after a division), what we want is to take all the digits except the first one, for that reason we find the modulo of the number when divided by ten to the power of the length of the number minus one, for example, if the number is 2734 we divided by 10^(4-1), where four is the length of the number, this way we get 2734/1000 and the module of it is 734.

5 0
3 years ago
Which one of the following features can control left and right indents on using markers
QveST [7]
The Feature that can control left and right indents on using markers is Ruler.  The indent marker consists of two triangles and a rectangle.  <span>To change the left indent, click on the very bottom of the indent marker, the rectangle, and drag it to a new position.</span>  <span>The Right Indent is indicated by a single triangle on the Ruler at the current right margin. Click and drag it to change the margin.</span>
3 0
3 years ago
Other questions:
  • Which activity constitutes legal computer activity?
    12·1 answer
  • Why is it important to know much time you spend on task
    8·1 answer
  • Cyberterrorism is the use of terrorism to attack (Points : 1) public libraries. computer based networks. government spy networks
    15·1 answer
  • Put these steps for managing your study time in chronological order. 1 set aside the same time each day 2 Identify the best time
    14·1 answer
  • How a computer encodes text, how it is processed and how computer data is represented.
    6·1 answer
  • Suppose your name was George Gershwin. Write a complete main method that would print your last name, followed by a comma, follow
    9·1 answer
  • Allows a user to control the<br>volume of the computer​
    8·1 answer
  • What is a fire wall and how does it work
    6·1 answer
  • Role of memory in a computer system
    10·1 answer
  • What does advance mean​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!