Add new linked list operations: delete and clear functions

This commit is contained in:
2025-07-20 22:51:19 +08:00
parent 4f7a07025a
commit ac374e89bf
3 changed files with 274 additions and 0 deletions
+17
View File
@@ -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;
}