diff --git a/sorting/quick_sort.cpp b/sorting/quick_sort.cpp index 965d117cc..08db9c92e 100644 --- a/sorting/quick_sort.cpp +++ b/sorting/quick_sort.cpp @@ -26,11 +26,14 @@ #include #include -/* This function takes last element as pivot, places -the pivot element at its correct position in sorted -array, and places all smaller (smaller than pivot) -to left of pivot and all greater elements to right -of pivot */ +/** + * This function takes last element as pivot, places + * the pivot element at its correct position in sorted + * array, and places all smaller (smaller than pivot) + * to left of pivot and all greater elements to right + * of pivot + * + * */ int partition(int arr[], int low, int high) { int pivot = arr[high]; // taking the last element as pivot @@ -52,10 +55,12 @@ int partition(int arr[], int low, int high) { return (i + 1); } -/* The main function that implements QuickSort -arr[] --> Array to be sorted, -low --> Starting index, -high --> Ending index */ +/** + * The main function that implements QuickSort + * arr[] --> Array to be sorted, + * low --> Starting index, + * high --> Ending index +*/ void quickSort(int arr[], int low, int high) { if (low < high) { int p = partition(arr, low, high);