diff --git a/docs/notes/剑指 Offer 题解 - 20~29.md b/docs/notes/剑指 Offer 题解 - 20~29.md index 51d49793..0480b2c6 100644 --- a/docs/notes/剑指 Offer 题解 - 20~29.md +++ b/docs/notes/剑指 Offer 题解 - 20~29.md @@ -68,7 +68,7 @@ public boolean isNumeric(char[] str) { 需要保证奇数和奇数,偶数和偶数之间的相对位置不变,这和书本不太一样。 -

+

## 解题思路 @@ -98,7 +98,7 @@ public void reOrderArray(int[] nums) { 设链表的长度为 N。设两个指针 P1 和 P2,先让 P1 移动 K 个节点,则还有 N - K 个节点可以移动。此时让 P1 和 P2 同时移动,可以知道当 P1 移动到链表结尾时,P2 移动到 N - K 个节点处,该位置就是倒数第 K 个节点。 -

+

```java public ListNode FindKthToTail(ListNode head, int k) { @@ -132,8 +132,7 @@ public ListNode FindKthToTail(ListNode head, int k) { 在相遇点,slow 要到环的入口点还需要移动 z 个节点,如果让 fast 重新从头开始移动,并且速度变为每次移动一个节点,那么它到环入口点还需要移动 x 个节点。在上面已经推导出 x=z,因此 fast 和 slow 将在环入口点相遇。 -

- +

```java public ListNode EntryNodeOfLoop(ListNode pHead) { @@ -194,7 +193,7 @@ public ListNode ReverseList(ListNode head) { ## 题目描述 -

+

## 解题思路 @@ -246,7 +245,7 @@ public ListNode Merge(ListNode list1, ListNode list2) { ## 题目描述 -

+

## 解题思路 @@ -274,7 +273,7 @@ private boolean isSubtreeWithRoot(TreeNode root1, TreeNode root2) { ## 题目描述 -

+

## 解题思路 @@ -300,7 +299,7 @@ private void swap(TreeNode root) { ## 题目描述 -

+

## 解题思路 @@ -330,7 +329,7 @@ boolean isSymmetrical(TreeNode t1, TreeNode t2) { 下图的矩阵顺时针打印结果为:1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10 -

+

## 解题思路 diff --git a/docs/pics/0c12221f-729e-4c22-b0ba-0dfc909f8adf.jpg b/docs/pics/0c12221f-729e-4c22-b0ba-0dfc909f8adf.jpg new file mode 100644 index 00000000..d8d6e239 Binary files /dev/null and b/docs/pics/0c12221f-729e-4c22-b0ba-0dfc909f8adf.jpg differ diff --git a/docs/pics/48517227-324c-4664-bd26-a2d2cffe2bfe.png b/docs/pics/48517227-324c-4664-bd26-a2d2cffe2bfe.png new file mode 100644 index 00000000..75630786 Binary files /dev/null and b/docs/pics/48517227-324c-4664-bd26-a2d2cffe2bfe.png differ diff --git a/docs/pics/6b504f1f-bf76-4aab-a146-a9c7a58c2029.png b/docs/pics/6b504f1f-bf76-4aab-a146-a9c7a58c2029.png new file mode 100644 index 00000000..f00cc769 Binary files /dev/null and b/docs/pics/6b504f1f-bf76-4aab-a146-a9c7a58c2029.png differ diff --git a/docs/pics/84a5b15a-86c5-4d8e-9439-d9fd5a4699a1.jpg b/docs/pics/84a5b15a-86c5-4d8e-9439-d9fd5a4699a1.jpg new file mode 100644 index 00000000..2f37c2d3 Binary files /dev/null and b/docs/pics/84a5b15a-86c5-4d8e-9439-d9fd5a4699a1.jpg differ diff --git a/docs/pics/bb7fc182-98c2-4860-8ea3-630e27a5f29f.png b/docs/pics/bb7fc182-98c2-4860-8ea3-630e27a5f29f.png new file mode 100644 index 00000000..c624d346 Binary files /dev/null and b/docs/pics/bb7fc182-98c2-4860-8ea3-630e27a5f29f.png differ diff --git a/docs/pics/c094d2bc-ec75-444b-af77-d369dfb6b3b4.png b/docs/pics/c094d2bc-ec75-444b-af77-d369dfb6b3b4.png new file mode 100644 index 00000000..6342a97f Binary files /dev/null and b/docs/pics/c094d2bc-ec75-444b-af77-d369dfb6b3b4.png differ diff --git a/docs/pics/d03a2efa-ef19-4c96-97e8-ff61df8061d3.png b/docs/pics/d03a2efa-ef19-4c96-97e8-ff61df8061d3.png new file mode 100644 index 00000000..2082f8f3 Binary files /dev/null and b/docs/pics/d03a2efa-ef19-4c96-97e8-ff61df8061d3.png differ