Skip to content

Commit

Permalink
add file
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmykobe1171 committed Dec 19, 2014
1 parent f86d6fd commit e719e68
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Solution:
# @return a tree node
def sortedArrayToBST(self, num):
def array_to_bst(array, begin, end):
if begin >= end:
return TreeNode(array[begin])
if begin > end:
return None

mid = (begin + end) / 2
mid_node = TreeNode(array[mid])
Expand Down

0 comments on commit e719e68

Please sign in to comment.