Regarding this video


sir i am getting segmentation fault can you please check

issue is with your rest of the function, right code is this

if(head==NULL&&head->next==NULL){
           return head;
       }
       node*slow=head;
       node*fast=head;
       while(fast!=NULL&&fast->next!=NULL){
           fast=fast->next->next;
           slow=slow->next;
       }
   return  slow;

take reference from this