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

Function quickSort

CPP/sorting/randomised_quicksort.cpp:43–51  ·  view source on GitHub ↗

Quicksort method

Source from the content-addressed store, hash-verified

41
42// Quicksort method
43void quickSort(int arr[], int low, int high) {
44 if (low < high) {
45 int pIndex = partition_r(arr, low, high);
46
47 // Separately sort elements before partition and after partition
48 quickSort(arr, low, pIndex - 1);
49 quickSort(arr, pIndex + 1, high);
50 }
51}
52
53int main() {
54 int size;

Callers 1

mainFunction · 0.70

Calls 1

partition_rFunction · 0.85

Tested by

no test coverage detected