modified comment block

This commit is contained in:
Ayaan Khan
2020-05-27 18:48:22 +05:30
parent c1764bd197
commit 50d6a14b2a

View File

@@ -26,11 +26,14 @@
#include <cstdlib>
#include <iostream>
/* 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);