MCPcopy Create free account
hub / github.com/geekcomputers/Python / quickSort

Function quickSort

Sorting Algorithms/Quick sort.py:25–36  ·  view source on GitHub ↗
(arr, low, high)

Source from the content-addressed store, hash-verified

23
24
25def quickSort(arr, low, high):
26 if len(arr) == 1:
27 return arr
28 if low < high:
29 # pi is partitioning index, arr[p] is now
30 # at right place
31 pi = partition(arr, low, high)
32
33 # Separately sort elements before
34 # partition and after partition
35 quickSort(arr, low, pi - 1)
36 quickSort(arr, pi + 1, high)
37
38
39# Driver code to test above

Callers 1

Quick sort.pyFile · 0.85

Calls 1

partitionFunction · 0.70

Tested by

no test coverage detected