Eroxl's Notes
In-Order Binary Tree Traversal

In-order traversal is a type of depth-first traversal for binary trees in which the left subtree is visited and then the current node is visited and finally the right subtree is visited.

class BinaryTreeNode:
    def __init__(self, value, left=None, right=None):
        self.value = value

        self.left = left
        self.right = right


def in_order_traverse(root, visit):
    if root is None:
        return

    in_order_traverse(root.left, visit)
    
    visit(root.value)

	in_order_traverse(root.right, visit)