Cycle detection and removal in ll


why is it giving segmentation error for LL which is not circular

correct condition for while loop is

while(large!=NULL&&large->next!=NULL)
    {