struct node{
int value;
struct node *next;
};
void rearrange(struct node *list)
{struct node *p,*q;
int temp;
if(!list || !list->next)return
p=list;q=list->next;
if(q)
{
temp=p->value;
p->value=q->value;
q->value=temp;
q=p?p->next:0;
}
}
}
list is containing the integers 1,2,3,4,5,6,7
then the output is?
also what's the meaning of p=list(as per me its the HEADER, then p->value is 0 or something else? confirm)