I want to detect loop in following cases
1-2-3-4-5
|----------| ===> case 1
1-2-3-4-5
|-------| ===> case 2
In case 1 cycle detection algorithm works correctly but not for case 2. I did dry run for case 2 I found that hare pointer ends normally. Also I thought that case 2 is not valid singly linked list as it contains 2 next pointer. Is my assumption correct for case 2? The whole scenario is for singly linked list?