Circular linklist


pls help me to resolve this problem

Hello @jontysingla85,

The linked list you have formed is structurally linear.
There is no actual loop or cycle in it.
Thus, the fast and slow pointers will not work for the linked list you have created.

Solution:

  1. just look for the repeating element in your linked list and break it from there to remove cycle.
  2. to apply two pointers approach that you have written, create a cycle in your linked list.
    You can refer to this code I have corrected earlier:
    https://ide.codingblocks.com/s/161841

Hope, this would help.
Give a like if you are satisfied.