0 votes 0 votes Consider the following code fragment to detect a cycle/loop in a given singly linked list. Find the missing statement S1. p!=NULL q!=NULL (p!=NULL || q!=NULL) (p!=NULL && q!==NULL) Anirban Biswas asked Jan 16, 2017 Anirban Biswas 371 views answer comment Share Follow See 1 comment See all 1 1 comment reply srestha commented Jan 16, 2017 reply Follow Share https://gateoverflow.in/99515/data-structure 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes I think ans is OPTION 3 because suppose when p==null that condition also need to be checked and q=null because we want to end while loop as soon as fast pointer which is 'q' either loops or reaches end. robin sharma answered Jan 16, 2017 robin sharma comment Share Follow See all 0 reply Please log in or register to add a comment.