void sortlist()
{
struct node *a;
struct node *temp=head;
struct node *temp1=head->next;
while(temp!=NULL)
{
while(temp1->next!=NULL)
{
if(temp->data > temp1->data)
{
a->data=temp->data;
temp->data=temp1->data;
temp1->data=a->data;
}
else
{
temp1=temp1->next;
}
}
temp=temp->next;
}
}
//I am new to data structures.i am encountering some problem here while trying to sort elements of linked list.list does not get sorted.any help is greatly appreciated.