void Merge(dataType A[], int F, int mid, int L)
{
dataType temp[MAX];
int First1 = F; int Last1 = mid;
int First2 = mid + 1; int Last2 = L;
int Index = First1;
for (; (First1 <= Last1) && (First2 <= Last2); ++Index)
{
if (A[First1] < A[First2])
{
temp[Index] = A[First2];
++First1;
}
else
{
temp[Index] = A[First2];
++First2;
}
}
for (; First1 <= Last1; ++First1, ++Index)
temp[Index] = A[First1];
for (; First2 <= Last2; ++First2, ++Index)
temp[Index] = A[First2];
for (Index = F; Index <= L; ++Index)
A[Index] = temp[Index];
}
dataType이랑 MAX가 정의되어 있지 않다는데???
댓글 0