Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this flipped to where it will print the currentVal in Descending order, Not Ascending. Thanks template void writeMiniVector(const miniVector& v) { for (int

I need this flipped to where it will print the "currentVal in Descending order", Not Ascending.

Thanks

template void writeMiniVector(const miniVector& v) { for (int i = 0; i < v.size(); i++) cout << " " << v[i];

cout << endl << endl; } // use insertion sort to place miniVector v to place in a descending order template void sortMiniVector(miniVector& v) { int i, j, currentVal; for (i = 1; i < v.size(); i++) { currentVal = v[i]; j = i - 1;

///compare with each previous element and swap if previous is greater than the one before while (j >= 0 && v[j] > currentVal) { v[j + 1] = v[j]; j = j - 1; } v[j + 1] = currentVal; } } //end Unit3-4Prog

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

Step: 3

blur-text-image

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books