sorts.quick_sort¶
A pure Python implementation of the quick sort algorithm
For doctests run following command: python3 -m doctest -v quick_sort.py
For manual testing run: python3 quick_sort.py
Attributes¶
Functions¶
|
A pure Python implementation of quicksort algorithm. |
Module Contents¶
- sorts.quick_sort.quick_sort(collection: list) list ¶
A pure Python implementation of quicksort algorithm.
- Parameters:
collection – a mutable collection of comparable items
- Returns:
the same collection ordered in ascending order
Examples: >>> quick_sort([0, 5, 3, 2, 2]) [0, 2, 2, 3, 5] >>> quick_sort([]) [] >>> quick_sort([-2, 5, 0, -45]) [-45, -2, 0, 5]
- sorts.quick_sort.user_input¶