Skip to content

Commit 738de29

Browse files
authored
Update construct_binary_tree_from_preorder_and_inorder_traversal.py
1 parent 7d7f1e7 commit 738de29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

construct_binary_tree_from_preorder_and_inorder_traversal.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# coding: utf-8
22

33
class Solution:
44
"""
@@ -24,4 +24,6 @@ def _buildTree(self, preorder, pre_start, pre_end, inorder, in_start, in_end):
2424
root.left = self._buildTree(preorder, pre_start + 1, pre_start +1 + left_len, inorder, in_start, i)
2525
# 生成右子树
2626
root.right = self._buildTree(preorder, pre_start + 1 + left_len, pre_end, inorder, i + 1, in_end)
27-
return root
27+
return root
28+
29+
# medium: http://lintcode.com/zh-cn/problem/construct-binary-tree-from-preorder-and-inorder-traversal/

0 commit comments

Comments
 (0)