diff --git a/chapter_array_and_linkedlist/linked_list.md b/chapter_array_and_linkedlist/linked_list.md index 77e4a1d6f..c9414c1c4 100755 --- a/chapter_array_and_linkedlist/linked_list.md +++ b/chapter_array_and_linkedlist/linked_list.md @@ -328,8 +328,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ void insert(ListNode n0, ListNode P) { ListNode n1 = n0.next; - n0.next = P; P.next = n1; + n0.next = P; } ``` @@ -339,8 +339,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ void insert(ListNode* n0, ListNode* P) { ListNode* n1 = n0->next; - n0->next = P; P->next = n1; + n0->next = P; } ``` @@ -350,8 +350,8 @@ comments: true """ 在链表的结点 n0 之后插入结点 P """ def insert(n0, P): n1 = n0.next - n0.next = P P.next = n1 + n0.next = P ``` === "Go" @@ -360,8 +360,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ func insertNode(n0 *ListNode, P *ListNode) { n1 := n0.Next - n0.Next = P P.Next = n1 + n0.Next = P } ``` @@ -371,8 +371,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ function insert(n0, P) { const n1 = n0.next; - n0.next = P; P.next = n1; + n0.next = P; } ``` @@ -382,8 +382,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ function insert(n0: ListNode, P: ListNode): void { const n1 = n0.next; - n0.next = P; P.next = n1; + n0.next = P; } ``` @@ -400,8 +400,8 @@ comments: true void insert(ListNode n0, ListNode P) { ListNode? n1 = n0.next; - n0.next = P; P.next = n1; + n0.next = P; } ``` @@ -411,8 +411,8 @@ comments: true /* 在链表的结点 n0 之后插入结点 P */ func insert(n0: ListNode, P: ListNode) { let n1 = n0.next - n0.next = P P.next = n1 + n0.next = P } ``` @@ -422,8 +422,8 @@ comments: true // 在链表的结点 n0 之后插入结点 P fn insert(n0: ?*inc.ListNode(i32), P: ?*inc.ListNode(i32)) void { var n1 = n0.?.next; - n0.?.next = P; P.?.next = n1; + n0.?.next = P; } ``` diff --git a/chapter_preface/about_the_book.md b/chapter_preface/about_the_book.md index d756a17c0..603e1fed7 100644 --- a/chapter_preface/about_the_book.md +++ b/chapter_preface/about_the_book.md @@ -10,7 +10,7 @@ comments: true 回想自己当初在“扫雷式”刷题中被炸的满头包的痛苦,思考良久,**我意识到一本“前期刷题必看”的读物可以使算法小白少走许多弯路**。写作意愿滚滚袭来,那就动笔吧: -
动画图解、能运行、可提问的数据结构与算法快速入门教程
[](https://github.com/krahets/hello-algo)