Skip to content

Commit a4888a6

Browse files
authored
Update Validate Binary Search Tree - Leetcode 98.py
1 parent 456a804 commit a4888a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Validate Binary Search Tree - Leetcode 98.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ def is_valid(node, minn, maxx):
1010
return is_valid(node.left, minn, node.val) and is_valid(node.right, node.val, maxx)
1111

1212
return is_valid(root, float("-inf"), float("inf"))
13+
14+
# Time Complexity: O(n)
15+
# Space Complexity: O(h) { here "h" is height of tree }

0 commit comments

Comments
 (0)