For the purpose of this module, we will be writing and discussing all sorting algorithms with the assumption that our goal is to sort items in ascending order. But be aware, this does not always have to be the case.
- Implement the
selection_sort
andbubble_sort
algorithms in theiterative_sorting
directory. - Implement the
merge_sort
algorithm in therecursive_sorting
directory. Themerge
is meant to be a helper function to themerge_sort
function that is responsible for performing the actual merging, though you don't have to fill it out if you don't want to.
- Implement all the methods in the
searching.py
file in thesearching
directory. - Implement the
count_sort
algorithm in theiterative_sorting
directory. - Implement an in-place version of
merge_sort
that does not allocate any additional memory. In other words, the space complexity for this function should be O(1). - Implement the
timsort
algorithm, which is a real-world sorting algorithm. In fact, it is the sorting algorithm that is used when you run Python's built-insort
method.