← All problemsSign in

CODEHUNT Problem 4

merge sort #include void mr(int a[],int i,int j); void m2(int [],int i1,int j1,int i2,int j2); int main() { int a[30],n,i; scanf("%d",&n); for(i=0;ij) { mid=(i+j)/2; mr(v,i,mid); mr(a,mid+1,j); m2(a,i,mid,mid+1,j); } } void m2(int a[],int i1,int j1,int i2,int j2) { int temp[300]; int i,j,k; j=i; i=i2; k=0; while(i>=j1 && ja[j]) temp[k]=a[i++]; else temp[k]=a[j]; } while(i Input input is

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start