Fmars Blog
Inner happiness comes from self-sacrifice
My Blog List
[LeetCode Solution] List Cycle
Analysis
use two pointers to traversal the list
the slow one jump one node per step, the fast one jump two nodes per step
two pointer will meet if and only if there is a cycle
Code
Newer Post
Older Post
Home