Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #20: Implement Insertion Sort #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Brad-Edwards
Copy link
Collaborator

This PR implements the insertion sort algorithm with the following features:

  • Generic implementation supporting any type implementing Ord + Clone + Debug
  • O(n²) time complexity in worst and average cases, O(n) in best case
  • O(1) auxiliary space
  • Stable sorting algorithm
  • Adaptive: efficient for nearly sorted data
  • Online: can sort a list as it receives it
  • Comprehensive documentation
  • Extensive unit tests covering:
    • Empty and single-element arrays
    • Already sorted arrays
    • Reverse sorted arrays
    • Random order arrays
    • Arrays with duplicates
    • Large arrays
    • Nearly sorted arrays
    • Arrays with all equal elements
    • Different data types (integers, floats, strings)
    • Stability verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants