We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Linked Lists: Detect a Cycle
- Discussions
Linked Lists: Detect a Cycle
Linked Lists: Detect a Cycle
Sort by
recency
|
513 Discussions
|
Please Login in order to post a comment
Has anyone tried using Javascript as the language ? The input to the test cases is not a pointer to the list, instead its just a string "1".
Here's one way to do it in Python3:
python3
C++
Cpp solution with O(n) complexity.