def level_width(root, level):
    """Get level height: number of notes in a certain level."""
    if root is None:
        return 0
    if level == 1:
        return 1
    else:
        return (level_width(root.sx, level - 1) +
                level_width(root.dx, level - 1))