Skip to content

Hacktoberfest: Add group_odd_even_nodes algorithm to Linked Lists #3573

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

Conversation

shermanhui
Copy link
Contributor

@shermanhui shermanhui commented Oct 20, 2020

Describe your change:

Adding the algorithm I used to solve
https://leetcode.com/problems/odd-even-linked-list/
for #2510

This groups odd indexed nodes in a Linked List at the beginning of the
list and then the even indexed nodes following the odd indexed nodes.

Note that the nodes are not grouped by their value but by their
index. This algo runs in O(1) space and O(n) time.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • 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 have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@shermanhui shermanhui force-pushed the add-group-odd-even-linked-list-nodes branch from 32c2535 to 4916b8d Compare October 20, 2020 05:44
@shermanhui shermanhui force-pushed the add-group-odd-even-linked-list-nodes branch from ae6afc7 to ab52157 Compare October 22, 2020 18:02
Adding the algorithm I used to solve
https://leetcode.com/problems/odd-even-linked-list/

This groups odd indexed nodes in a Linked List at the beginning of the
list and then the even indexed nodes following the odd indexed nodes.

Note that the nodes are not grouped by their value but by their
index. This algo runs in O(1) space and O(n) time.

Add geeksforgeeks url for additional details on algorithm
@shermanhui shermanhui force-pushed the add-group-odd-even-linked-list-nodes branch from bff2d38 to dac47aa Compare October 23, 2020 00:49
@shermanhui shermanhui closed this Oct 24, 2020
@shermanhui shermanhui reopened this Oct 24, 2020
@shermanhui
Copy link
Contributor Author

@mateuszz0000 @poyea I know the reviewers are super swamped due to the influx of Hacktoberfest PRs 😅 , but just pinging for a review here as I feel that I've taken the efforts to follow through the contributing guidelines to genuinely participate in the spirit of Hacktoberfest, but my PR was buried under a lot of invalid ones. Appreciate it! 👍

@stale
Copy link

stale bot commented Nov 24, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Nov 24, 2020
@stale
Copy link

stale bot commented Dec 8, 2020

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Used to mark an issue or pull request stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants