diff --git a/Quick.cpp b/Quick.cpp new file mode 100644 index 0000000..160fea2 --- /dev/null +++ b/Quick.cpp @@ -0,0 +1,44 @@ +#include +#define parr(arr,s) for(int i=0;i>arr[i++]); + +using namespace std; + +void swap(int *a, int *b){ + int tmp = *a; + *a = *b; + *b = tmp; +} + +int partition(int a[],int l,int h){ + int i=l,j=h,pivot=a[l]; + + do{ + do{i++;}while(a[i]<=pivot); + do{j--;}while(a[j]>pivot); + if(i