From 949115f2349ba9e8e40fcab32739e306350de11a Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Sat, 7 Nov 2026 17:10:23 +0800 Subject: [PATCH] =?UTF-8?q?Update=207.=20=E9=87=8D=E5=BB=BA=E4=BA=8C?= =?UTF-8?q?=E5=8F=89=E6=A0=91.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一 img 标签的写法。 --- notes/7. 重建二叉树.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/7. 重建二叉树.md b/notes/7. 重建二叉树.md index 02f9231a..1c49bc0c 100644 --- a/notes/7. 重建二叉树.md +++ b/notes/7. 重建二叉树.md @@ -18,7 +18,7 @@ 设根在中序遍历中的下标为 inIndex,左子树的节点数 leftTreeSize = inIndex - inL。在前序遍历中,根后面紧跟着的 leftTreeSize 个值是左子树,剩下的是右子树,由此得到递归时左右子树在前序数组中的范围。用哈希表记录中序遍历中每个值的下标,找根的位置只需要 O(1),整体时间复杂度为 O(N)。 -

+

```java // 缓存中序遍历数组每个值对应的索引