Added search feature
This commit is contained in:
@@ -24,3 +24,20 @@ 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