From 6d21f20ca12e3f44c23928c1a80bf0214c0c814e Mon Sep 17 00:00:00 2001 From: Mohit Singh Date: Mon, 11 Feb 2019 00:29:18 +0530 Subject: [PATCH] Create Quick Sort --- Quick Sort/QuickSort.c | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Quick Sort/QuickSort.c diff --git a/Quick Sort/QuickSort.c b/Quick Sort/QuickSort.c new file mode 100644 index 0000000..66170eb --- /dev/null +++ b/Quick Sort/QuickSort.c @@ -0,0 +1,85 @@ +#include +#include +int count; +void quicksort(int[], int, int); +int partition(int[], int, int); +int main() +{ + int a[1200],b[1200],c[1200],c1,c2,c3,i,j,n; + printf("Enter the number of elements: "); + scanf("%d",&n); + printf("Enter the elements: "); + for(i = 0; i < n; i++) + scanf("%d",&a[i]); + quicksort(a,0,n-1); + printf("Sorted Array:"); + for(i=0;i=p && j>low) + { + j--; + count++; + } + count++; + if(i