src/benchmark.py
def tree_size(root: TreeNode):
    '''
    Count the number of nodes in a tree
    '''
    if root is None:
        return 0
    return 1 + tree_size(root.right) + tree_size(root.left)

    Count the number of nodes in a tree
    
Count the number of nodes in a tree
Count the number of nodes in a tree
def tree_size(root: TreeNode):
    if root is None:
        return 0
    return 1 + tree_size(root.right) + tree_size(root.left)
def tree_size ( root : TreeNode ) : if root is None : return 0 return 1 + tree_size ( root . right ) + tree_size ( root . left )
Count the number of nodes in a tree
Count the number of nodes in a tree
'''
    Count the number of nodes in a tree
    '''
root
TreeNode