Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C + + PROGRAMMING: You are given an input array A [ 1 , dots, N ] . A grouping of the array A is

C++ PROGRAMMING:
You are given an input array A[1,dots,N]. A grouping of the array A is described by an array G[1,dots,M],
where the array A is partitioned into M groups, the 1sit group consists of the first G[1] elements of array A,
the 2nd group consists of the next G[2] elements, and so forth. Define array B[1,dots,M] such that B[j] is
the summation of the elements in the j-th group of array A. Use a dynamic programming algorithm to find
a grouping of array A with M groups such that we maximize the minimum element of array B.
Max-min-grouping (A,N,M)
{
return G[1,dots,M]
}
Hint:
The optimal subproblem property: suppose the optimal solution to Max-min-grouping (A,N,M)
is G[1,dots,M]=[n1,n2,dots,nM-1,nM]. Then G[1,dots,M-1] is the optimal solution to the
subproblem Max-min-grouping (A,N-nM,M-1).
The ANSWER should have the following parts:
(1) Pseudo codes of your dynamic programming algorithm.
(2) Analysis of the running time asymptotically.
(3) Grouping results of several input examples including the one that A={3,9,7,8,2,6,5,10,1,7,6,4} and M=3(At least 4 examples).
(4) Full Source codes.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions