For reference, An implementation of Quick Sort(in-place) in C: quicksort.cpp at master · anuragiiits

Read more… (14 words)

Active In

Competitive Programming

Bitcoin and Blockchain

CommonLounge Meta

Featured Contributions

comment in this discussion

For reference, An implementation of Quick Sort(in-place) in C: quicksort.cpp at master · anuragiiits

Read more… (14 words)

comment in this discussion

Here's a C version of Merge-sort:

#include<stdio.h>void merge(int arr[],int l, int h, int mid){int p=l,m=l,i;int n=mid+1;int t[100];while(m<=mid || n<=h){if (m<=mid && n<=h && arr[m]<=arr[n]){t[p-l]=arr[m++];p++;}else if (m<=mid && n<=h && arr[m]>arr[n]){t[p-l]=arr[n++];p++;}else if(m>mid){t[p-l]=arr[n++];

Read more… (6 words)