[Code Addition Request]: addition of linked list cycle detection algorithm #897
Labels
Contributor
Denotes issues or PRs submitted by contributors to acknowledge their participation.
gssoc-ext
hacktoberfest
level1
Status: Assigned💻
Indicates an issue has been assigned to a contributor.
Have you completed your first issue?
Guidelines
Latest Merged PR Link
#891 (comment)
#891
Project Description
Problem Statement:
Given the head of a linked list, determine if the list contains a cycle. A cycle occurs if a node in the list points back to a previous node, allowing traversal to loop indefinitely.
Solution Approach Using Slow and Fast Pointers:
To detect a cycle, we use two pointers, slow and fast, that traverse the list at different speeds:
This two-pointer technique efficiently detects cycles in O(n) time complexity without extra space.
Full Name
Sanat Kumar Gupta
@SKG24
Participant Role
gssoc-ext, hacktoberfest
The text was updated successfully, but these errors were encountered: