MiniAssignment 2 Solution

$30.00 $24.00

Assume that the monthly pro ts of a company are given in an array, each entry representing the pro ts for the corresponding month. Propose an algorithm to nd a group of consecutive months where the pro t was the highest. For example, the pro ts, in millions, for a year Jan-Dec is given by…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Assume that the monthly pro ts of a company are given in an array, each entry representing the pro ts for the corresponding month. Propose an algorithm to nd a group of consecutive months where the pro t was the highest.

For example, the pro ts, in millions, for a year Jan-Dec is given by A=[2-5340-158-91-20];

The highest pro t was from the period March-August and the value is 19 million. Assume that the array can be very large{not just 12 months. Submit a well comment pseudocode along with an example of the algorithm works. Grading scheme: (your grade will be based on which ever class your algorithm falls in)

For algorithms with complexity O(n3) or higher (4 pts) For algorithms with complexity O(n2) (6 pts)

For algorithms with complexity O(nlogn)(8 pts) For algorithms with complexity O(n) (10 pts)

1

MiniAssignment 2 Solution
$30.00 $24.00