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

Function quick_sort

Sorting Algorithms/quick_sort.py:26–35  ·  view source on GitHub ↗
(nums)

Source from the content-addressed store, hash-verified

24
25
26def quick_sort(nums):
27 # Create a helper function that will be called recursively
28 def _quick_sort(items, low, high):
29 if low < high:
30 # This is the index after the pivot, where our lists are split
31 split_index = partition(items, low, high)
32 _quick_sort(items, low, split_index)
33 _quick_sort(items, split_index + 1, high)
34
35 _quick_sort(nums, 0, len(nums) - 1)
36
37
38# Verify it works

Callers 1

quick_sort.pyFile · 0.70

Calls 1

_quick_sortFunction · 0.85

Tested by

no test coverage detected