Skip to content

Kate-Way/Start-of-the-Linked-List-Cycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c9bbb83 · Sep 13, 2022

History

3 Commits
Sep 13, 2022
Sep 13, 2022

Repository files navigation

Start-of-the-Linked-List-Sycle

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return None.

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer.

Do not modify the linked list.

I used the most optimal Floyd's Tortoise and Hare Algorithm to find the answer with O(n) time and O(1) space complexity.

About

Floyd's Tortoise and Hare Algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages