Skip to content

Added 2 new linked list operations one for finding cycles and one for reversing the list#1201

Closed
achak47 wants to merge 2 commits intoTheAlgorithms:masterfrom
achak47:master
Closed

Added 2 new linked list operations one for finding cycles and one for reversing the list#1201
achak47 wants to merge 2 commits intoTheAlgorithms:masterfrom
achak47:master

Conversation

@achak47
Copy link

@achak47 achak47 commented Jan 29, 2023

Description of Change

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

@@ -0,0 +1,51 @@
#include <stdio.h>
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 a one-line description of what the library/header is for


int main()
{
struct Node* head = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

According the https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md#test . What do you think about moving your example into the test method with asserts?


int detectLoop(struct Node* list)
{
struct Node *slow_p = list, *fast_p = list;
Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly, It's a Floyd's tortoise and hare algorithm. Probably it's better to add a comment about this. That would be easy to recognize it in the future.

@Panquesito7 Panquesito7 added the enhancement New feature or request label Jan 30, 2023
@Panquesito7
Copy link
Member

Great comments, @alexpantyukhin. Thanks for your help! 🚀

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

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

@github-actions github-actions bot added the Stale label Mar 2, 2023
@github-actions
Copy link
Contributor

Please ping one of the maintainers 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 ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants