Skip to content

Commit 909ff01

Browse files
Create sol.py
1 parent bb055b7 commit 909ff01

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Function to find the minimum element in the given BST.
2+
def minValue(root):
3+
if not root:
4+
return None
5+
6+
current = root
7+
8+
# loop down to find the lefmost leaf
9+
while current.left:
10+
current = current.left
11+
12+
return current.data

0 commit comments

Comments
 (0)