diff --git a/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif b/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif new file mode 100644 index 00000000..a6552b51 Binary files /dev/null and b/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif differ diff --git a/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif b/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif new file mode 100644 index 00000000..d5a4eec5 Binary files /dev/null and b/docs/notes/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif differ diff --git a/docs/notes/剑指 offer 题解.md b/docs/notes/剑指 offer 题解.md index 939ee792..2f2a0c9a 100644 --- a/docs/notes/剑指 offer 题解.md +++ b/docs/notes/剑指 offer 题解.md @@ -316,12 +316,14 @@ preorder = [3,9,20,15,7] inorder = [9,3,15,20,7] ``` -

+

## 解题思路 前序遍历的第一个值为根节点的值,使用这个值将中序遍历结果分成两部分,左部分为树的左子树中序遍历结果,右部分为树的右子树中序遍历的结果。 +

+ ```java // 缓存中序遍历数组每个值对应的索引 private Map indexForInOrders = new HashMap<>(); diff --git a/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif b/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif new file mode 100644 index 00000000..a6552b51 Binary files /dev/null and b/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-1.gif differ diff --git a/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif b/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif new file mode 100644 index 00000000..d5a4eec5 Binary files /dev/null and b/docs/pics/_u91CD_u5EFA_u4E8C_u53C9_u6811-21548502782193.gif differ