Added search feature
This commit is contained in:
BIN
Binary file not shown.
@@ -27,3 +27,17 @@ void display()
|
|||||||
temp=temp->next;
|
temp=temp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int search(int value)
|
||||||
|
{
|
||||||
|
Node *temp = head;
|
||||||
|
|
||||||
|
while(temp != NULL)
|
||||||
|
{
|
||||||
|
if(temp->data == value)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
temp = temp->next;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,5 +11,6 @@ typedef struct Node
|
|||||||
|
|
||||||
void insert(int data);
|
void insert(int data);
|
||||||
void display();
|
void display();
|
||||||
|
int search(int value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user