Skip to content

Fix Bug: Missing Edge Case for odd_even_transposition_parallel.py #10976

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

Closed
wants to merge 6 commits into from
Closed

Conversation

hoarffrost
Copy link

Describe your change:

This enhanced code includes fixed bugs pointed out by @RaymondDashWu. The problem with the Algorithm was that it assumed the length of the array to be sorted equal to 10 (check the 1st for loop inside the function oe_process), which is why when @RaymondDashWu tried sorting an array with length 11, the returned sorted array is not as expected. So, I just passed an argument named arr_len which contains the array's length value.
In addition to fixing this bug, this code includes exception handling for user input, and more detailed docstrings. It's now more robust and readable.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 26, 2023
@hoarffrost
Copy link
Author

Hi, can any of the admins merge this pr, if possible✌️

@hoarffrost
Copy link
Author

Hi, can any of the admins merge this pr, if possible✌️

Hey @tianyizheng02 can you please review this pr.❤️
THANKS

Comment on lines +33 to +39
position,
value,
l_send,
r_send,
lr_cv,
rr_cv,
result_pipe,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add type hints.

@cclauss
Copy link
Member

cclauss commented Oct 27, 2023

This branch has conflicts that must be resolved

sorts/odd_even_transposition_parallel.py

@cclauss cclauss self-assigned this Oct 29, 2023
@cclauss cclauss added the awaiting changes A maintainer has requested changes to this PR label Oct 29, 2023
@cclauss
Copy link
Member

cclauss commented Sep 30, 2024

Closing awaiting_changes PRs to prepare for Hacktoberfest 2024

@cclauss cclauss closed this Sep 30, 2024
@surya111111
Copy link

surya111111 commented Sep 30, 2024 via email

@cclauss
Copy link
Member

cclauss commented Sep 30, 2024

Not mad at all. These PRs were closed by automated scripts. Please feel free to try again tomorrow under Hacktoberfest 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes A maintainer has requested changes to this PR awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants