第一题写完辣

This commit is contained in:
2024-10-19 00:53:12 +08:00
parent f675daad41
commit 0dd0c19bd1
3 changed files with 15 additions and 0 deletions
+13
View File
@@ -47,3 +47,16 @@ void display(bookList *l) {
}
}
}
int getLength(bookList *l) {
if (isEmpty(l)) {
return 0;
}
bookNode *temp = (*l)->next;
int length = 0;
while (temp != NULL) {
length++;
temp = temp->next;
}
return length;
}