Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

Visualizer › Trees

Inorder Traversal

Visits the left subtree, then the node, then the right subtree. On a binary search tree it lists the keys in sorted order.

How it works

Complexity

Code (Python)

def inorder(node, out):
    if node:
        inorder(node.left, out)
        out.append(node.val)
        inorder(node.right, out)

Practise: Trees problems