Question: WRITE IN C++ Your function will track the index into the subvector whose contents sum to the largest (most positive) integer value and record what

WRITE IN C++

WRITE IN C++ Your function will track the index into the subvector

Your function will track the index into the subvector whose contents sum to the largest (most positive) integer value and record what that sum was. Keep in mind that the subvector may have positive and negative values. Since the two-dimensional vector is non-rectangular, you cannot assume that the subvectors contain an equal number of elements: the number of elements stored in one subvector can (and will) differ. If more than one subvector sums to the same value and that value is the largest sum, record the subvector with the smaller index. What does a smaller index mean? Given a two-dimensional vector indexed as vect. at (subvector_idx). at(subvector_ele_idx), we mean the subvector residing at the smaller value of subvector_idx. Once you're finished examining the twodimensional vector, create a new LargestsumPair object, initializing the data member index with the index to the subvector whose contents sum to the largest (most positive) integer value and sum with the sum calculated for that subvector. Assume the two-dimensional vector passed to your function will have at least one subvector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!