a:
while(temp->data<data)
{
k=temp;
temp=temp->next;
if(temp==NULL)
break;
}
b:
while(temp->data<data&&temp!=NULL)
{
k=temp;
temp=temp->next;
}
Question:
I cant find any difference between above two while loops but getting correct answer only by a) and segmentation fault by b)