Added search feature
This commit is contained in:
BIN
Binary file not shown.
@@ -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;
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ typedef struct Node
|
||||
|
||||
void insert(int data);
|
||||
void display();
|
||||
int search(int value);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user