- Published on
Binary Search Tree Inorder Traversal
74 words1 min read
Binary Search Tree Inorder Traversal
Time Complexity O(N)
This approach is recursive, with O(N) time Complexity.
To print the values in the ascending order!
def inorder(root):
if not root:
return
inorder(root.left)
print(root.val)
inorder(root.right)