Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++, write a Merge Sort method to sort a vector of strings alphabetically. Here is how it would be used: //main int main(){ vector

Using C++, write a Merge Sort method to sort a vector of strings alphabetically. Here is how it would be used:

//main

int main(){

vector myVector = {"zip", "go", "light", "apple", "yes"};

MergeSort m;

m.sort(myVector);

printVector(&myVector);

return 0;

}

void printVector(vector &myVector){

for(int i=0; i

cout << myVector[i];

}

}

// class MergeSort.cpp

vector MergeSort::sort(vector myVector){

// ++++++++++++ Merge Sort algorithm here ++++++++

// doesnt need to be a complete running program, just need a little help

// with this algorithm, thank you

return myVector;

}

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

More Books

Students also viewed these Databases questions

Question

Approach the lectern with assurance and enthusiasm.

Answered: 1 week ago