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

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

//main

int main(){

vector myVector = {"one", "two", "three", "four", "five"};

QuickSort q;

q.sort(myVector);

printVector(myVector);

return 0;

}

void printVector(vector &myVector){

for(int i=0; i

cout << myVector[i];

}

}

// class QuickSort.cpp

vector QuickSort::sort(vector myVector){

// ++++++++++++ Quick 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

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!