From da2f781c3998e74aa3d62af32f314096d2acf132 Mon Sep 17 00:00:00 2001 From: abster12 Date: Mon, 23 Oct 2017 19:20:55 +0530 Subject: [PATCH] Create quicksort.cpp --- quicksort.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 quicksort.cpp diff --git a/quicksort.cpp b/quicksort.cpp new file mode 100644 index 0000000..1805a93 --- /dev/null +++ b/quicksort.cpp @@ -0,0 +1,68 @@ +#include + +using namespace std; + +void quick_sort(int[],int,int); +int partition(int[],int,int); + +int main() +{ + int a[50],n,i; + cout<<"How many elements?"; + cin>>n; + cout<<"\nEnter array elements:"; + + for(i=0;i>a[i]; + + quick_sort(a,0,n-1); + cout<<"\nArray after sorting:"; + + for(i=0;i