Added search feature
This commit is contained in:
@@ -27,3 +27,17 @@ void display()
|
||||
temp=temp->next;
|
||||
}
|
||||
}
|
||||
|
||||
int search(int value)
|
||||
{
|
||||
Node *temp = head;
|
||||
|
||||
while(temp != NULL)
|
||||
{
|
||||
if(temp->data == value)
|
||||
return 1;
|
||||
|
||||
temp = temp->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user