AIBauchi / PyDS-A

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.
MIT License
8 stars 12 forks source link

implement insertion_sort.py #53

Closed avi-dey closed 12 months ago

avi-dey commented 12 months ago

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.

Screenshot from 2023-10-06 02-19-42

Checklist

Author

Avijit Dey (@avi-dey)

Tinny-Robot commented 12 months ago

Hello @avi-dey Thank you for your contribution,