diff --git a/styles/quick_sort.cpp b/styles/quick_sort.cpp new file mode 100644 index 0000000..6d03069 --- /dev/null +++ b/styles/quick_sort.cpp @@ -0,0 +1,13 @@ +/* low --> Starting index, high --> Ending index */ +quickSort(arr[], low, high) +{ + if (low < high) + { + /* pi is partitioning index, arr[pi] is now + at right place */ + pi = partition(arr, low, high); + + quickSort(arr, low, pi - 1); // Before pi + quickSort(arr, pi + 1, high); // After pi + } +}