class Leaf(object):
    '''Create leaf.'''
    def __init__(self, key, left=None, right=None):
        self.left = left
        self.key = key
        self.right = right


class Tree(object):
    '''Create tree'''

    def __init__(self, root=None):
        self.root = root

    def _contains(self, key, leaf):
        if leaf is None or leaf.key == key:
            return bool(leaf)
        elif key < leaf.key:
            return self._contains(key, leaf.left)
        else:
            return self._contains(key, leaf.right)

    def contains(self, key):
        return self._contains(key, self.root)

    def insert(self, key):
        if not self.root:
            self.root = Leaf(key)
        else:
            self._insert(key, self.root)

    def _insert(self, key, leaf):
        if leaf is None:
            return Leaf(key)
        elif key == leaf.key:
            return Leaf(key, leaf.left, leaf.right)
        elif key < leaf.key:
            return Leaf(leaf.key, self.insert(key, leaf.left), leaf.right)
        else:
            return Leaf(leaf.key, leaf.left, self.insert(key, leaf.right))

    def size(self):
        if not self.root:
            return 0
        else:
            return self._size(self.root, 1)

    def _size(self, leaf, count):
        if leaf.left:
            count += 1
            count = self._size(leaf.left, count)
        if leaf.right:
            count += 1
            count = self._size(leaf.right, count)
        return count

@@ -1478,8 +1478,463 @@
 n count%0A
+%0A    def depth(self):%0A        if not self.root:%0A            return 0%0A        else:%0A            return self._depth(self.root)%0A%0A    def _depth(self, leaf):%0A        if leaf is None:%0A            return 0%0A        else:%0A            depthL = self._depth(leaf.left)%0A            depthR = self._depth(leaf.right)%0A        return max(%5BdepthL, depthR%5D) + 1%0A%0Aif __name__ == '__main__':%0A    t = Tree()%0A    t.insert(10)%0A    t.insert(15)%0A    t.insert(5)%0A    print(t.size)%0A

add depth method.