PyDS-A: Python Data Structures and Algorithms Library - Your go-to resource for essential data structures and algorithms, implemented in Python. Improve your coding skills and optimize your programs with this comprehensive collection.
Implementation of Insertion sort algorithm, that builds the final sorted array (or list) one item at a time by comparisons.
Related Issue
Closes: #16
Testing
Test with python3 -m doctest -v insertion_sort.py and pass all the tests. Doctests include 3 different lists and their outputs that needed to be passed.
All of mypy, black and ruff tests were performed and all gave no errors.
Checklist
[x] Followed the code style and conventions.
[x] Added appropriate comments and documentation.
[x] Updated or added unit tests, if necessary.
[x] Checked for any linting errors or warnings.
[x] Verified that the code builds and runs without errors.
Implement Insertion Sort
Description
Implementation of Insertion sort algorithm, that builds the final sorted array (or list) one item at a time by comparisons.
Related Issue
Closes: #16
Testing
Test with python3 -m doctest -v insertion_sort.py and pass all the tests. Doctests include 3 different lists and their outputs that needed to be passed. All of mypy, black and ruff tests were performed and all gave no errors.
Checklist
Author
Avijit Dey (@avi-dey)