mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-06 23:28:29 +08:00
Update 0707.设计链表.md
结构体语法有错,中间有个free少了分号
This commit is contained in:
@ -157,7 +157,7 @@ private:
|
||||
## 其他语言版本
|
||||
C:
|
||||
```C
|
||||
typedef struct {
|
||||
typedef struct MyLinkedList {
|
||||
int val;
|
||||
struct MyLinkedList* next;
|
||||
}MyLinkedList;
|
||||
@ -233,7 +233,7 @@ void myLinkedListDeleteAtIndex(MyLinkedList* obj, int index) {
|
||||
MyLinkedList *tmp = obj->next;
|
||||
if (tmp != NULL){
|
||||
obj->next = tmp->next;
|
||||
free(tmp)
|
||||
free(tmp);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -263,20 +263,21 @@ void myLinkedListFree(MyLinkedList* obj) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* Your MyLinkedList struct will be instantiated and called as such:
|
||||
* MyLinkedList* obj = myLinkedListCreate();
|
||||
* int param_1 = myLinkedListGet(obj, index);
|
||||
|
||||
|
||||
* myLinkedListAddAtHead(obj, val);
|
||||
|
||||
|
||||
* myLinkedListAddAtTail(obj, val);
|
||||
|
||||
|
||||
* myLinkedListAddAtIndex(obj, index, val);
|
||||
|
||||
|
||||
* myLinkedListDeleteAtIndex(obj, index);
|
||||
|
||||
|
||||
* myLinkedListFree(obj);
|
||||
*/
|
||||
*/
|
||||
```
|
||||
|
||||
Java:
|
||||
|
Reference in New Issue
Block a user