diff --git a/docs-en/index.assets/btn_chinese_edition.svg b/docs-en/index.assets/btn_chinese_edition.svg
index f8a4b21d7..9f069e89c 100644
--- a/docs-en/index.assets/btn_chinese_edition.svg
+++ b/docs-en/index.assets/btn_chinese_edition.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs-en/index.assets/btn_chinese_edition_dark.svg b/docs-en/index.assets/btn_chinese_edition_dark.svg
index e96c12f38..c9ed76940 100644
--- a/docs-en/index.assets/btn_chinese_edition_dark.svg
+++ b/docs-en/index.assets/btn_chinese_edition_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs-en/index.assets/btn_download_pdf.svg b/docs-en/index.assets/btn_download_pdf.svg
index e486da953..ed236a077 100644
--- a/docs-en/index.assets/btn_download_pdf.svg
+++ b/docs-en/index.assets/btn_download_pdf.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs-en/index.assets/btn_download_pdf_dark.svg b/docs-en/index.assets/btn_download_pdf_dark.svg
index 99266fde5..308cfeda0 100644
--- a/docs-en/index.assets/btn_download_pdf_dark.svg
+++ b/docs-en/index.assets/btn_download_pdf_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs-en/index.assets/btn_read_online.svg b/docs-en/index.assets/btn_read_online.svg
index ba1d2c684..a2500e44f 100644
--- a/docs-en/index.assets/btn_read_online.svg
+++ b/docs-en/index.assets/btn_read_online.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs-en/index.assets/btn_read_online_dark.svg b/docs-en/index.assets/btn_read_online_dark.svg
index debaba56c..ddf3a6b2e 100644
--- a/docs-en/index.assets/btn_read_online_dark.svg
+++ b/docs-en/index.assets/btn_read_online_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/chapter_array_and_linkedlist/linked_list.md b/docs/chapter_array_and_linkedlist/linked_list.md
index 1b5f034dc..1e8399246 100755
--- a/docs/chapter_array_and_linkedlist/linked_list.md
+++ b/docs/chapter_array_and_linkedlist/linked_list.md
@@ -875,9 +875,10 @@ comments: true
```c title="linked_list.c"
/* 访问链表中索引为 index 的节点 */
ListNode *access(ListNode *head, int index) {
- while (head && head->next && index) {
+ for (int i = 0; i < index; i++) {
+ if (head == NULL)
+ return NULL;
head = head->next;
- index--;
}
return head;
}
diff --git a/docs/index.assets/btn_download_pdf.svg b/docs/index.assets/btn_download_pdf.svg
index 1f5b47963..e77fe0312 100644
--- a/docs/index.assets/btn_download_pdf.svg
+++ b/docs/index.assets/btn_download_pdf.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/index.assets/btn_download_pdf_dark.svg b/docs/index.assets/btn_download_pdf_dark.svg
index f24cc1f99..039e36688 100644
--- a/docs/index.assets/btn_download_pdf_dark.svg
+++ b/docs/index.assets/btn_download_pdf_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/index.assets/btn_english_edition.svg b/docs/index.assets/btn_english_edition.svg
index 4bf9f5d3b..96cfd50c3 100644
--- a/docs/index.assets/btn_english_edition.svg
+++ b/docs/index.assets/btn_english_edition.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/index.assets/btn_english_edition_dark.svg b/docs/index.assets/btn_english_edition_dark.svg
index aea14a45b..da9903e7c 100644
--- a/docs/index.assets/btn_english_edition_dark.svg
+++ b/docs/index.assets/btn_english_edition_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/index.assets/btn_read_online.svg b/docs/index.assets/btn_read_online.svg
index 354221143..aacbc6577 100644
--- a/docs/index.assets/btn_read_online.svg
+++ b/docs/index.assets/btn_read_online.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/index.assets/btn_read_online_dark.svg b/docs/index.assets/btn_read_online_dark.svg
index b5aef7e2b..96a6c9133 100644
--- a/docs/index.assets/btn_read_online_dark.svg
+++ b/docs/index.assets/btn_read_online_dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file