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_sortandbubble_sortalgorithms in theiterative_sortingdirectory. - Implement the
merge_sortalgorithm in therecursive_sortingdirectory. Themergeis meant to be a helper function to themerge_sortfunction 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.pyfile in thesearchingdirectory. - Implement the
count_sortalgorithm in theiterative_sortingdirectory. - Implement an in-place version of
merge_sortthat does not allocate any additional memory. In other words, the space complexity for this function should be O(1). - Implement the
timsortalgorithm, which is a real-world sorting algorithm. In fact, it is the sorting algorithm that is used when you run Python's built-insortmethod.