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

#897 cycle detection in linked list #910

Merged
merged 3 commits into from
Oct 29, 2024
Merged

#897 cycle detection in linked list #910

merged 3 commits into from
Oct 29, 2024

Conversation

SKG24
Copy link
Contributor

@SKG24 SKG24 commented Oct 28, 2024

Given the head of a linked list, determine if the linked list contains a cycle. A cycle exists if a node in the list points back to an earlier node, creating a loop in the list. Internally, a variable pos represents the index of the node that the tail's next pointer is connected to. If there is no cycle, pos is -1.

Pull Request for PyVerse 💡

#897

Requesting to submit a pull request to the PyVerse repository.


Issue Title Addition of

Addition of Detection of Cycle in Linked List

  • I have provided the issue title.

Info about the Related Issue

What's the goal of the project?
It is python code to detect cycle in Linked List.
Describe the aim of the project.
I have use slow and fast pointer to test for cycle in the list

  • I have described the aim of the project.

Name

Sanat Kumar Gupta

  • I have provided my name.

GitHub ID

@SKG24
Enter your GitHub ID here.

  • I have provided my GitHub ID.

Email ID

Please mention your email ID for further communication.
gupta.sanat24@gmail.com

  • I have provided my email ID.

Identify Yourself

Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
Enter your participant role here.
gssoc-ext, hacktoberfest

  • I have mentioned my participant role.

Closes

Enter the issue number that will be closed through this PR.
Closes: #issue-number #897

  • I have provided the issue number.

Describe the Add-ons or Changes You've Made

Give a clear description of what you have added or modified.
Describe your changes here.
addition of python algorithm to test for cycle in the list. I have added readme file and program file

  • I have described my changes.

Type of Change

Select the type of change:

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Code style update (formatting, local variables)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

How Has This Been Tested?

Describe how your changes have been tested.
Describe your testing process here.
Used compiler to test the code

https://github.com/user-attachments/assets/84391f24-96d3-481c-925d-7dedca0f709d
Screenshot 2024-10-28 at 7 26 03 PM

  • I have described my testing process.

Checklist

Please confirm the following:

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Given the `head` of a linked list, determine if the linked list contains a cycle. A cycle exists if a node in the list points back to an earlier node, creating a loop in the list. Internally, a variable `pos` represents the index of the node that the tail's `next` pointer is connected to. If there is no cycle, `pos` is `-1`.
Copy link

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@UTSAVS26 UTSAVS26 merged commit 0cc449c into UTSAVS26:main Oct 29, 2024
@UTSAVS26 UTSAVS26 added Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. Status: Approved ✔️ PRs that have passed review and are approved for merging. level1 gssoc-ext hacktoberfest hacktoberfest-accepted labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. gssoc-ext hacktoberfest hacktoberfest-accepted level1 Status: Approved ✔️ PRs that have passed review and are approved for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants