Live Practice
Binary Search Tree
Visualise the recursion. Implement a function to find the maximum depth of a BST with optimal time complexity.
# Find Max Depth
def maxDepth(root):
if not root:
return 0
return 1 + max(
maxDepth(root.left),
maxDepth(root.right)
)