Add new linked list operations: delete and clear functions
This commit is contained in:
@@ -81,5 +81,22 @@ int main()
|
||||
} while (number!=-1);
|
||||
print(&list);
|
||||
|
||||
scanf("%d", &number);
|
||||
Node *p;
|
||||
int isFound = 0;
|
||||
for (p=list.head; p; p=p->next)
|
||||
{
|
||||
if (p->value==number)
|
||||
{
|
||||
printf("找到!\n");
|
||||
isFound = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isFound)
|
||||
{
|
||||
printf("未找到!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user