TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.82k stars 7.29k forks source link

[FEATURE] Tortoise and Hare algorithm #2811

Closed Chetan-KH511 closed 1 month ago

Chetan-KH511 commented 1 month ago

Detailed description

The Tortoise and Hare algorithm,( Floyd’s Cycle Detection Algorithm) is used to detect cycles in a sequence of values or linked lists. Same algo is used to detect many other thing like kth node from last, starting point of cycle or middle of linked list.

Context

Please assign this to me under hactoberfest.

Possible implementation

No response

Additional information

No response