So, in the case of these two functions, I input something like:
BSTTree.maxValue(BSTTree.root)
and let's say the BST looked something like this:
6
/ \
3 7
\
8
\
9
for max value it returns a "None" value. If i print out each root value, it will stop printing at 8... :/
Any ideas?
def maxValue(self, root):
if (root.right is None):
return root.value
if (root.right is not None):
self.maxVal(root.right)
print root.value
def minValue(self, root):
if (root.left is None):
return root.value
else:
if (root.left is not None):
self.minValue(root.left)