diff --git a/Quick Sort.cpp b/Quick Sort.cpp new file mode 100644 index 000000000..b2bb21a77 --- /dev/null +++ b/Quick Sort.cpp @@ -0,0 +1,69 @@ +/* C implementation QuickSort */ +#include +using namespace std; + +int partition (int arr[], int low, int high) +{ + int pivot = arr[high]; // pivot + int i = (low - 1); // Index of smaller element + + for (int j = low; j >size; + + int arr[size]; + + cout<<"\nEnter the unsorted elements : "; + + for (int i = 0; i < size; ++i) + { + cout<<"\n"; + cin>>arr[i]; + } + quickSort(arr, 0, size); + cout<<"Sorted array\n"; + show(arr, size); + return 0; +}