### Need some help

So, I need to use a mergesort to organize the names by alphabetical order and also the height ..

I am totally confused, I am having major difficulty with c++, the following is what I pieced together from an example in class, please help!

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111`` ``````#include #include #include #include "person.h" void quicksort(person people[], int start, int end); using namespace std; int main() { const int num_people = 10; person people[num_people]; people[0].name = "Mulan"; people[0].height = 157.5; people[1].name = "Tiana"; people[1].height = 165; people[2].name = "Aladdin"; people[2].height = 177.5; people[3].name = "Esmeralda"; people[3].height = 170; people[4].name = "Gaston"; people[4].height = 190; people[5].name = "Donald"; people[5].height = 137; people[6].name = "Daisy"; people[6].height = 135; people[7].name = "Baloo"; people[7].height = 188; people[8].name = "Goofy"; people[8].height = 185.5; people[9].name = "Mary"; people[9].height = 167.5; cout << "Unsorted:\n"; for (int i=0; i= end) return; int pivot_index = ( end + start )/ 2;// Pivot index int pivot_value = people[pivot_index]; vector lesser, greater; for (int i = start; i <= end; i++) { if ( i == pivot_index) continue; if (people[i] <= pivot_value) lesser.push_back(people[i]); else greater.push_back(people[i]); } int j = start; for (int i = 0; i
Topic archived. No new replies allowed.