Update 0707.设计链表.md

结构体语法有错,中间有个free少了分号
This commit is contained in:
Re1own
2022-12-26 00:29:02 -05:00
committed by GitHub
parent 846ca75573
commit 78909ff5aa

View File

@ -157,7 +157,7 @@ private:
## 其他语言版本 ## 其他语言版本
C: C:
```C ```C
typedef struct { typedef struct MyLinkedList {
int val; int val;
struct MyLinkedList* next; struct MyLinkedList* next;
}MyLinkedList; }MyLinkedList;
@ -233,7 +233,7 @@ void myLinkedListDeleteAtIndex(MyLinkedList* obj, int index) {
MyLinkedList *tmp = obj->next; MyLinkedList *tmp = obj->next;
if (tmp != NULL){ if (tmp != NULL){
obj->next = tmp->next; obj->next = tmp->next;
free(tmp) free(tmp);
} }
return; return;
} }
@ -263,6 +263,7 @@ void myLinkedListFree(MyLinkedList* obj) {
} }
/** /**
* Your MyLinkedList struct will be instantiated and called as such: * Your MyLinkedList struct will be instantiated and called as such:
* MyLinkedList* obj = myLinkedListCreate(); * MyLinkedList* obj = myLinkedListCreate();
* int param_1 = myLinkedListGet(obj, index); * int param_1 = myLinkedListGet(obj, index);