[FEATURE REQUEST] <title>Adding Hare and Tortoise Algorithm
What would you like to Propose?
I would like to contribute Hare and Tortoise Algorithm as it is one of the most important concept when it comes to linked list
Issue details
I will add the algorithm in the linked list part
Additional Information
No response
Hello Bhumika
I am working on the issue and will be adding the Algorithm in the Linked List Section.
What would you like to propose? I would like to propose the addition of the "Hare and Tortoise Algorithm" (also known as Floyd’s cycle detection algorithm) to the repository. This algorithm is useful for detecting cycles in a sequence, particularly in linked lists. Implementing this in Java would be a valuable addition to the existing algorithms in the repository.
Issue details The Hare and Tortoise algorithm works by having two pointers move through the sequence at different speeds: one (the hare) moves two steps at a time, while the other (the tortoise) moves one step at a time. If there is a cycle, the two pointers will eventually meet. This algorithm is commonly used in problems involving linked lists to detect cycles efficiently, with O(n) time complexity and O(1) space complexity.
Additional Information The proposed implementation will include both a standard use case for detecting a cycle in a linked list and a brief explanation of its time and space complexity. The code will follow Java best practices and will include comprehensive test cases to ensure functionality and correctness. This algorithm is widely recognized and often appears in technical interviews, making it a valuable resource for learners and developers.
[FEATURE REQUEST] Adding Hare and Tortoise Algorithm #5693 https://github.com/TheAlgorithms/Java/issues/5693
Can you please assign me this issue
On Fri, 11 Oct, 2024, 8:43 pm BRIAN BAZURTO, @.***> wrote:
I am working in the issue
— Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/Java/issues/5693#issuecomment-2407622288, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKOHTVSXSGXMVYK52JQ6NG3Z27TJRAVCNFSM6AAAAABPV52JV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBXGYZDEMRYHA . You are receiving this because you authored the thread.Message ID: @.***>
This issue 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 contribution!
Please reopen this issue once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!