Question: I need help making a program in c++ for merge sort and quick sort reading from a text file name in.text help below is my
I need help making a program in c++ for merge sort and quick sort reading from a text file name in.text help
below is my program but gives wrong order :'(
void merge(std::vector
while (l <= mid && m <= r) { if (array->at(i) <= array->at(m)) vTemp.at(k++) = array->at(l++); else vTemp.at(k++) = array->at(m++); }
while (l <= mid) vTemp.at(k++) = array->at(l++);
while (m <= r) vTemp.at(k++) = array->at(m++);
for (int i1 = i; i1 <= j; i1++) array->at(i1) = vTemp.at(i1); }
void merges(std::vector
void mergesort(std::vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
