Skip to content

Commit baaa874

Browse files
committed
update
1 parent 2d08f24 commit baaa874

4 files changed

+11
-2
lines changed

Python/convertSortedArrayToBinarySearchTree.py renamed to Python/convert-sorted-array-to-binary-search-tree.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Given an array where elements are sorted in ascending order,
55
# convert it to a height balanced BST.
6-
6+
#
77
# Definition for a binary tree node
88
class TreeNode:
99
def __init__(self, x):
@@ -31,4 +31,4 @@ def sortedArrayToBSTRecu(self, num, start, end):
3131
result = Solution().sortedArrayToBST(num)
3232
print result.val
3333
print result.left.val
34-
print result.right.val
34+
print result.right.val

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,17 @@ Problem | Solution | Time | Space | Difficul
149149
--------------- | --------------- | --------------- | --------------- | -------------- | -----
150150
[Construct Binary Tree from Inorder and Postorder Traversal] | [construct-binary-tree-from-inorder-and-postorder-traversal.py] | _O(n)_ | _O(n)_ | Medium |
151151
[Construct Binary Tree from Preorder and Inorder Traversal] | [construct-binary-tree-from-preorder-and-inorder-traversal.py] | _O(n)_ | _O(n)_ | Medium
152+
[Convert Sorted Array to Binary Search Tree] | [convert-sorted-array-to-binary-search-tree.py] | _O(n)_ | _O(logn)_ | Medium |
153+
[Convert Sorted List to Binary Search Tree] | [convert-sorted-list-to-binary-search-tree.py] | _O(n)_ | _O(logn)_ | Medium |
152154

153155
[Construct Binary Tree from Inorder and Postorder Traversal]:https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
154156
[construct-binary-tree-from-inorder-and-postorder-traversal.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/construct-binary-tree-from-inorder-and-postorder-traversal.py
155157
[Construct Binary Tree from Preorder and Inorder Traversal]:https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
156158
[construct-binary-tree-from-preorder-and-inorder-traversal.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/construct-binary-tree-from-preorder-and-inorder-traversal.py
159+
[Convert Sorted Array to Binary Search Tree]:https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
160+
[convert-sorted-array-to-binary-search-tree.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/convert-sorted-array-to-binary-search-tree.py
161+
[Convert Sorted List to Binary Search Tree]:https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/
162+
[convert-sorted-list-to-binary-search-tree.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/convert-sorted-list-to-binary-search-tree.py
157163

158164

159165
---
@@ -238,9 +244,12 @@ Problem | Solution | Time | Space | Difficul
238244
--------------- | --------------- | --------------- | --------------- | -------------- | -----
239245
[Best Time to Buy and Sell Stock II]| [best-time-to-buy-and-sell-stock-ii.py] | _O(n)_ | _O(1)_ | Medium |
240246
[Candy]| [candy.py] | _O(n)_ | _O(n)_ | Hard |
247+
[Container With Most Water]| [container-with-most-water.py] | _O(n)_ | _O(1)_ | Medium |
241248

242249
[Best Time to Buy and Sell Stock II]:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
243250
[best-time-to-buy-and-sell-stock-ii.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/best-time-to-buy-and-sell-stock-ii.py
244251
[Candy]:https://oj.leetcode.com/problems/candy/
245252
[candy.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/candy.py
253+
[Container With Most Water]:https://oj.leetcode.com/problems/container-with-most-water/
254+
[container-with-most-water.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/container-with-most-water.py
246255

0 commit comments

Comments
 (0)