mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 00:43:04 +08:00
优化0106.从中序与后序遍历序列构造二叉树.mdJava解法
This commit is contained in:
@ -607,6 +607,7 @@ class Solution {
|
||||
for (int i = inLeft; i < inRight; i++) {
|
||||
if (inorder[i] == rootVal) {
|
||||
rootIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 根据rootIndex划分左右子树
|
||||
|
Reference in New Issue
Block a user