Skip to content

Conversation

@AsparkArcane
Copy link

Description
This pull request implements the main Sorter.sort() static method, which acts as a dispatcher for the various sorting algorithms in the class.

It provides a single, unified entry point for users, allowing them to select the desired algorithm (merge, insertion, or bubble) via a string parameter.

Closes #6

Changes

  • Added the sort() method to the Sorter class in sort.py.

  • The method normalizes the method parameter to lowercase for case-insensitive matching.

  • It uses an if/elif/else block to delegate to the appropriate sorting method (Sorter.merge(), Sorter.insertion(), or Sorter.bubble()).

  • A ValueError is raised with a descriptive message if an unknown method is provided.

Important Note
This PR only implements the dispatcher logic. The underlying sorting methods (merge, insertion, bubble) are currently placeholders (pass) and will be implemented in separate issues.

Because of this dependency, the tests for sort() in test_sort.py are expected to fail until the individual sorting algorithms are implemented and merged.

@lindelwa122
Copy link
Owner

@AsparkArcane, this is perfect. I will mark your PR as hacktoberfest-accepted. Keep refreshing the hacktoberfest page until it shows that your PR is in review. Then post a screenshot in the group. That's how I will keep track of your PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sort.sort

2 participants