def size ( self ) : if self is NULL : return 0 return 1 + self . left . size ( ) + self . right . size ( )
python len function complexity
Recursively find size of a tree . Slow .
def size(self):
        """
        Recursively find size of a tree. Slow.
        """

        if self is NULL:
            return 0
        return 1 + self.left.size() + self.right.size()