mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-07 15:45:40 +08:00
Update 0707.设计链表.md
结构体语法有错,中间有个free少了分号
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user