while(fast!=NULL and fast->next!=NULL)
How can we use this condition in Floyd’s cycle. There isn’t any NULL in it.
while(fast!=NULL and fast->next!=NULL)
How can we use this condition in Floyd’s cycle. There isn’t any NULL in it.
You don’t use NULL for it you use the condition fastptr == slowptr because if the Linked list do not have a cycle then fastptr can never be equal to slowprtr . But in case of a cycle they can be equal .
Hope it helps
. Mark your doubt as resolved if it is resolved or you can ask here if you have any further doubts . Thanks