Skip to content

Commit 4ca9300

Browse files
authored
Update construct_binary_tree_from_inorder_and_postorder_traversal.py
1 parent 738de29 commit 4ca9300

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

construct_binary_tree_from_inorder_and_postorder_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
"""
@@ -22,4 +22,6 @@ def _buildTree(self, inorder, in_start, in_end, postorder, post_start, post_end)
2222
left_len = i - in_start # 左子树元素数量
2323
root.left = self._buildTree(inorder, in_start, i, postorder, post_start, post_start + left_len)
2424
root.right = self._buildTree(inorder, i + 1, in_end, postorder, post_start + left_len, post_end - 1)
25-
return root
25+
return root
26+
27+
# medium: http://lintcode.com/zh-cn/problem/construct-binary-tree-from-inorder-and-postorder-traversal/

0 commit comments

Comments
 (0)