Modify the m_sort function such that, m_sort calls
m_sort for sub arrays with more than 512 elements, and m_sort calls
b_sort for sub arrays with 512 or less elements.
int data[5395978397]; // REALLY BIG array
void b_sort(int f, int l); // forward declaration
void m_sort(int f, int l) {
int m;
if (f<l) {
m = (f+l)/2;
m_sort(f,m);
m_sort(m+1,l);
merge(f,m,l);
}
}
Modify the m_sort function such that, m_sort calls m_sort for sub arrays with more than 512 elements, and m_sort calls b
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am