/*UnSorted search on an unsorted list*/
void unsortedsearch(list *head,int val)
{
list *temp;
if(head==NULL)
{printf(“nList is empty.”);
return;
}
temp=head;
/*searches for equality until number is found*/
/*best case is when first number is the required number*/
/*worst case is number does not exist*/
/*or number is present at last position in list*/
while(temp!=NULL)
{if(temp->n==val)
{printf(“nNumber found.”);
return;
}
temp=temp->next;
}
printf(“nNumber not found.”);
}