| 1 | class Node: # This is the Class Node with constructor that contains data variable to type data and left,right pointers. |
| 2 | def __init__(self, data): |
| 3 | self.data = data |
| 4 | self.left = None |
| 5 | self.right = None |
| 6 | |
| 7 | |
| 8 | def depth_of_tree(tree): #This is the recursive function to find the depth of binary tree. |