modified search feature
This commit is contained in:
@@ -6,18 +6,21 @@ int main()
|
||||
insert(10);
|
||||
insert(20);
|
||||
insert(30);
|
||||
printf("Linked List: ");
|
||||
|
||||
display();
|
||||
|
||||
if (search(20))
|
||||
Node *result = search(20);
|
||||
if (result != NULL)
|
||||
{
|
||||
printf("\nElement found\n");
|
||||
printf("\nElement found: %d\n", result->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\nElement not found\n");
|
||||
}
|
||||
printf("Total nodes = %d\n", count());
|
||||
|
||||
printf("Total nodes = %d\n", count());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user