MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / quickSort

Function quickSort

CPP/sorting/quicksort.cpp:41–53  ·  view source on GitHub ↗

The main function that implements QuickSort arr[] --> Array to be sorted, low --> Starting index, high --> Ending index */

Source from the content-addressed store, hash-verified

39low --> Starting index,
40high --> Ending index */
41void quickSort(int arr[], int low, int high)
42{
43 if (low < high) {
44 /* pi is partitioning index, arr[p] is now
45 at right place */
46 int pi = partition(arr, low, high);
47
48 // Separately sort elements before
49 // partition and after partition
50 quickSort(arr, low, pi - 1);
51 quickSort(arr, pi + 1, high);
52 }
53}
54
55/* Function to print an array */
56void printArray(int arr[], int size)

Callers 1

mainFunction · 0.70

Calls 1

partitionFunction · 0.70

Tested by

no test coverage detected